Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a code fixer for --isolatedDeclarations errors #58260

Merged
merged 15 commits into from Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/compiler/diagnosticMessages.json
Expand Up @@ -7184,6 +7184,46 @@
"category": "Message",
"code": 90061
},
"Add annotation of type '{0}'": {
"category": "Message",
"code": 90062
},
"Add return type '{0}'": {
"category": "Message",
"code": 90063
},
"Extract base class to variable": {
"category": "Message",
"code": 90064
},
"Extract default export to variable": {
"category": "Message",
"code": 90065
},
"Extract binding expressions to variable": {
"category": "Message",
"code": 90066
},
"Add all missing type annotations": {
"category": "Message",
"code": 90067
},
"Add satisfies and an inline type assertion with '{0}'": {
"category": "Message",
"code": 90068
},
"Extract to variable and replace with '{0} typeof {0}'": {
h-joo marked this conversation as resolved.
Show resolved Hide resolved
"category": "Message",
"code": 90069
},
"Mark array literal as const": {
"category": "Message",
"code": 90070
},
"Annotate types of properties expando function in a namespace": {
"category": "Message",
"code": 90071
},

"Convert function to an ES2015 class": {
"category": "Message",
Expand Down
1 change: 1 addition & 0 deletions src/services/_namespaces/ts.codefix.ts
Expand Up @@ -50,6 +50,7 @@ export * from "../codefixes/fixUnreachableCode";
export * from "../codefixes/fixUnusedLabel";
export * from "../codefixes/fixJSDocTypes";
export * from "../codefixes/fixMissingCallParentheses";
export * from "../codefixes/fixMissingTypeAnnotationOnExports";
export * from "../codefixes/fixAwaitInSyncFunction";
export * from "../codefixes/fixPropertyOverrideAccessor";
export * from "../codefixes/inferFromUsage";
Expand Down
1 change: 1 addition & 0 deletions src/services/codeFixProvider.ts
Expand Up @@ -127,6 +127,7 @@ function getDiagnostics({ program, sourceFile, cancellationToken }: CodeFixConte
return [
...program.getSemanticDiagnostics(sourceFile, cancellationToken),
...program.getSyntacticDiagnostics(sourceFile, cancellationToken),
...program.getDeclarationDiagnostics(sourceFile, cancellationToken),
jakebailey marked this conversation as resolved.
Show resolved Hide resolved
...computeSuggestionDiagnostics(sourceFile, program, cancellationToken),
];
}