@@ -257,19 +257,6 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
257257 result : result ,
258258 } ;
259259 process . send ! ( response ) ;
260-
261- // TODO: make sure the diagnostic diffing takes this into account
262- if ( ! utils . compilerLogPresentAndNotEmpty ( filePath ) ) {
263- let params2 : p . PublishDiagnosticsParams = {
264- uri : params . textDocument . uri ,
265- diagnostics : [ ] ,
266- }
267- let notification : m . NotificationMessage = {
268- jsonrpc : c . jsonrpcVersion ,
269- method : 'textDocument/publishDiagnostics' ,
270- params : params2 ,
271- } ;
272- }
273260 } else {
274261 let response : m . ResponseMessage = {
275262 jsonrpc : c . jsonrpcVersion ,
@@ -278,32 +265,17 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
278265 // technically a formatting failure should return the error but
279266 // since this is LSP... the idiom seems to be to silently return
280267 // nothing (to avoid an alert window each time on bad formatting)
281- // while sending a diangosis about the error afterward
268+ // while sending a diagnostic about the error afterward. We won't
269+ // send an extra diagnostic because the .compiler.log watcher
270+ // should have reported th won't send an extra diagnostic because
271+ // theiler.log watcher should have reported them.
282272
283273 // error: {
284274 // code: m.ErrorCodes.ParseError,
285275 // message: formattedResult.error,
286276 // }
287277 } ;
288278 process . send ! ( response ) ;
289-
290- if ( ! utils . compilerLogPresentAndNotEmpty ( filePath ) ) {
291- let filesAndErrors = utils . parseCompilerLogOutput ( formattedResult . error , ":" )
292- Object . keys ( filesAndErrors ) . forEach ( file => {
293- let params2 : p . PublishDiagnosticsParams = {
294- uri : params . textDocument . uri ,
295- // there's a new optional version param from https://github.com/microsoft/language-server-protocol/issues/201
296- // not using it for now, sigh
297- diagnostics : filesAndErrors [ file ] ,
298- }
299- let notification : m . NotificationMessage = {
300- jsonrpc : c . jsonrpcVersion ,
301- method : 'textDocument/publishDiagnostics' ,
302- params : params2 ,
303- } ;
304- process . send ! ( notification ) ;
305- } )
306- }
307279 }
308280 }
309281 }
0 commit comments