We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9453f4 commit 5e09e86Copy full SHA for 5e09e86
src/services/codefixes/fixUnreachableCode.ts
@@ -5,6 +5,8 @@ namespace ts.codefix {
5
registerCodeFix({
6
errorCodes,
7
getCodeActions(context) {
8
+ const syntacticDiagnostics = context.program.getSyntacticDiagnostics(context.sourceFile, context.cancellationToken);
9
+ if (syntacticDiagnostics.length) return;
10
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, context.span.start, context.span.length, context.errorCode));
11
return [createCodeFixAction(fixId, changes, Diagnostics.Remove_unreachable_code, fixId, Diagnostics.Remove_all_unreachable_code)];
12
},
0 commit comments