File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
packages/console/src/monaco Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -251,17 +251,18 @@ class MonacoProviders extends PureComponent<
251
251
} ;
252
252
}
253
253
254
- const diagnostics = MonacoProviders . getDiagnostics ( model )
255
- . filter ( d => d . code != null ) // Syntax errors have no code and can't be fixed/disabled
256
- . filter ( d => {
257
- const diagnosticRange = new monaco . Range (
258
- d . location . row ,
259
- d . location . column ,
260
- d . end_location . row ,
261
- d . end_location . column
262
- ) ;
263
- return diagnosticRange . intersectRanges ( range ) ;
264
- } ) ;
254
+ const diagnostics = MonacoProviders . getDiagnostics ( model ) . filter ( d => {
255
+ const diagnosticRange = new monaco . Range (
256
+ d . location . row ,
257
+ d . location . column ,
258
+ d . end_location . row ,
259
+ d . end_location . column
260
+ ) ;
261
+ return (
262
+ d . code != null && // Syntax errors have no code and can't be fixed/disabled
263
+ diagnosticRange . intersectRanges ( range )
264
+ ) ;
265
+ } ) ;
265
266
266
267
const fixActions : monaco . languages . CodeAction [ ] = diagnostics
267
268
. filter ( ( { fix } ) => fix != null )
@@ -274,7 +275,6 @@ class MonacoProviders extends PureComponent<
274
275
title = `Fix ${ d . code } ` ;
275
276
}
276
277
}
277
- const b = 4 ;
278
278
return {
279
279
title,
280
280
id : `fix-${ d . code } ` ,
@@ -314,6 +314,7 @@ class MonacoProviders extends PureComponent<
314
314
const disableLineActions : monaco . languages . CodeAction [ ] = diagnostics
315
315
. map ( d => {
316
316
if ( d . code == null ) {
317
+ // The nulls are already filtered out, but TS doesn't know that
317
318
return [ ] ;
318
319
}
319
320
const line = model . getLineContent ( d . location . row ) ;
You can’t perform that action at this time.
0 commit comments