Skip to content

Commit 709e3fc

Browse files
committed
Only get code fixes from declaration diagnostics when --isolatedDeclaration is on.
1 parent 0191a46 commit 709e3fc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/services/codeFixProvider.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,15 @@ export function eachDiagnostic(context: CodeFixAllContext, errorCodes: readonly
124124
}
125125

126126
function getDiagnostics({ program, sourceFile, cancellationToken }: CodeFixContextBase) {
127-
return [
127+
const diagnostics = [
128128
...program.getSemanticDiagnostics(sourceFile, cancellationToken),
129129
...program.getSyntacticDiagnostics(sourceFile, cancellationToken),
130-
...program.getDeclarationDiagnostics(sourceFile, cancellationToken),
131130
...computeSuggestionDiagnostics(sourceFile, program, cancellationToken),
132131
];
132+
if (program.getCompilerOptions().isolatedDeclarations) {
133+
diagnostics.push(
134+
...program.getDeclarationDiagnostics(sourceFile, cancellationToken),
135+
);
136+
}
137+
return diagnostics;
133138
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy