-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Add a code fixer for --isolatedDeclarations errors #58260
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4e506f9
Add a fixer to fix type errors for --isolatedDeclarations
h-joo 0191a46
(Non-functional) Apply 'npm run format' on fixMissingTypeAnnotationOn…
h-joo c9698a3
Only get code fixes from declaration diagnostics when --isolatedDecla…
h-joo 33e82b3
Add test cases for experimental / non-experimental decorators
h-joo 5704f4e
Suggest a type annotation for widened unions of type literals
h-joo cb45ffe
Call widening functions on the correct type when adding satisfies to …
h-joo 00e507c
npm run format
h-joo 023d32f
Take into account stylish changes from PR comments
h-joo 38f6a3d
Factor out a functionality to generate a variable name
h-joo 2086cb9
Update src/compiler/diagnosticMessages.json
h-joo 03cc990
Update tests
h-joo c4f0b81
Remove unused imports, also use getEmitDeclarations to check to provi…
h-joo 69d0044
Merge branch 'main' into isolated-declaration-fixer
h-joo 48ed32b
Fix the mis-resolution of merge conflict
h-joo 1632489
npm run format
h-joo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unused imports, also use getEmitDeclarations to check to provi…
…de fixes for them
- Loading branch information
commit c4f0b8112750386dbbb2da36fe194c8d21ec4ff5
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If currently we are supporting providing code fix for errors only when
--isolatedDeclarations
is turned on may be should get declaration diagnostics only if its on to avoid perf hitThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had them change to this in #58260 (comment), though; in the editor, we'll have already called this for diags, and it's cached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can flip it back to just isolatedDeclarations if you think it'll be a problem, but it seemed less error prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting Jake from the other comment
Would you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my comment was slightly late 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache does help a little but not whole lot since every edit will have to throw out the errors and recalculate them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, we call this function already and offer them up as diagnostics in the editor; won't the cost already have been paid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes i forgot about the part where LS.getSemanticDiagnostics gets declaration diagnostics as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, for posterity: