@@ -57,7 +57,7 @@ let projectsFiles: Map<
57
57
let codeActionsFromDiagnostics : codeActions . filesCodeActions = { } ;
58
58
59
59
// will be properly defined later depending on the mode (stdio/node-rpc)
60
- let send : ( msg : p . Message ) => void = ( _ ) => { } ;
60
+ let send : ( msg : p . Message ) => void = ( _ ) => { } ;
61
61
62
62
interface CreateInterfaceRequestParams {
63
63
uri : string ;
@@ -189,7 +189,11 @@ let openedFile = (fileUri: string, fileContent: string) => {
189
189
openFiles : new Set ( ) ,
190
190
filesWithDiagnostics : new Set ( ) ,
191
191
bsbWatcherByEditor : null ,
192
- hasPromptedToStartBuild : / ( \/ | \\ ) n o d e _ m o d u l e s ( \/ | \\ ) / . test ( projectRootPath ) ? "never" : false ,
192
+ hasPromptedToStartBuild : / ( \/ | \\ ) n o d e _ m o d u l e s ( \/ | \\ ) / . test (
193
+ projectRootPath
194
+ )
195
+ ? "never"
196
+ : false ,
193
197
} ;
194
198
projectsFiles . set ( projectRootPath , projectRootState ) ;
195
199
compilerLogsWatcher . add (
@@ -598,33 +602,30 @@ function format(msg: p.RequestMessage): Array<p.Message> {
598
602
}
599
603
}
600
604
601
- const updateDiagnosticSyntax = ( fileUri : string , fileContent : string ) => {
605
+ let updateDiagnosticSyntax = ( fileUri : string , fileContent : string ) => {
602
606
let filePath = fileURLToPath ( fileUri ) ;
603
607
let extension = path . extname ( filePath ) ;
604
608
let tmpname = utils . createFileInTempDir ( extension ) ;
605
609
fs . writeFileSync ( tmpname , fileContent , { encoding : "utf-8" } ) ;
606
610
607
- const items : p . Diagnostic [ ] | [ ] = utils . runAnalysisAfterSanityCheck (
608
- filePath ,
609
- [
610
- "diagnosticSyntax" ,
611
- tmpname
612
- ] ,
613
- ) ;
611
+ let items : p . Diagnostic [ ] | [ ] = utils . runAnalysisAfterSanityCheck ( filePath , [
612
+ "diagnosticSyntax" ,
613
+ tmpname ,
614
+ ] ) ;
614
615
615
- const notification : p . NotificationMessage = {
616
+ let notification : p . NotificationMessage = {
616
617
jsonrpc : c . jsonrpcVersion ,
617
618
method : "textDocument/publishDiagnostics" ,
618
619
params : {
619
620
uri : fileUri ,
620
- diagnostics : items
621
- }
622
- }
621
+ diagnostics : items ,
622
+ } ,
623
+ } ;
623
624
624
625
fs . unlink ( tmpname , ( ) => null ) ;
625
626
626
- send ( notification )
627
- }
627
+ send ( notification ) ;
628
+ } ;
628
629
629
630
function createInterface ( msg : p . RequestMessage ) : p . Message {
630
631
let params = msg . params as CreateInterfaceRequestParams ;
@@ -826,7 +827,10 @@ function onMessage(msg: p.Message) {
826
827
params . textDocument . uri ,
827
828
changes [ changes . length - 1 ] . text
828
829
) ;
829
- updateDiagnosticSyntax ( params . textDocument . uri , changes [ changes . length - 1 ] . text ) ;
830
+ updateDiagnosticSyntax (
831
+ params . textDocument . uri ,
832
+ changes [ changes . length - 1 ] . text
833
+ ) ;
830
834
}
831
835
}
832
836
} else if ( msg . method === DidCloseTextDocumentNotification . method ) {
0 commit comments