@@ -257,19 +257,6 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
257
257
result : result ,
258
258
} ;
259
259
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
- }
273
260
} else {
274
261
let response : m . ResponseMessage = {
275
262
jsonrpc : c . jsonrpcVersion ,
@@ -278,32 +265,17 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
278
265
// technically a formatting failure should return the error but
279
266
// since this is LSP... the idiom seems to be to silently return
280
267
// 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.
282
272
283
273
// error: {
284
274
// code: m.ErrorCodes.ParseError,
285
275
// message: formattedResult.error,
286
276
// }
287
277
} ;
288
278
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
- }
307
279
}
308
280
}
309
281
}
0 commit comments