Repository navigation
Odd quick fix ordering for misspelled identifiers #27614
Description
Activity
- changed the title
[-]Odd quick fixes for misspelled identifiers[/-][+]Odd quick fix ordering for misspelled identifiers[/+]on Oct 8, 2018 - addedBugA bug in TypeScriptA bug in TypeScriptHelp WantedYou can do thisYou can do thisGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.
on Oct 8, 2018 I'd like to give this one a shot if no one's working on it. This is my first issue so I would really appreciate it if someone could direct me to the files I should look at to fix this.
RyanCavanaugh commented
on Oct 10, 2018 MemberMore actionsjrkong you just have to change the ordering of the codefix files in the various
tsconfig.jsonfiles undersrcReacted by Lea ReimannRyan Cavanaugh (@RyanCavanaugh) thanks a lot! That really helps, I'll do some digging.
So after spending a bit of time with the code I've discovered some odd inconsistencies with the behavior for this particular bug:
When I attempt to reproduce the bug with the given line in the issue this is what I see:

However if I added the lines:
export {}; function f() {}Daniel Rosenwasser (@DanielRosenwasser) could you verify if I've reproduced the bug properly?
Here's where things got really odd for me:
Looking at the
src/services/tsconfig.jsonthe spelling code fixes are imported on line 54 and the code fixes for removing imports and unused dependencies are imported on line 62.So in theory
Change spelling to 'assertNever'should be loaded beforeRemove import from './Utilities'andDelete all unused declarations. What's more, the tests seem to corroborate that the source code is loading the spelling codefixes first:
Here's a screenshot of the test I've been working on and how it currently fails.

I deliberately tried testing against the incorrect output to verify the behavior of the bug before I made any further changes but the tests seem to imply that
Change spelling to 'assertNever'should already. So does anyone have any idea what's going on?Is this issue still up for grabs? Daniel Rosenwasser (@DanielRosenwasser)
DanielRosenwasser commented
on Oct 5, 2021 MemberAuthorMore actionsI think from the conversation above, this issue is too involved and needs some actual discussion at an editor sync first.
- addedIn DiscussionNot yet reached consensusNot yet reached consensusNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.and removedHelp WantedYou can do thisYou can do thisGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.
on Oct 5, 2021 DanielRosenwasser commented
on Oct 6, 2021 MemberAuthorMore actionsOne idea we had in the editor sync: an editor could ask about diagnostics with narrower spans than wider spans.
Another: an editor could provide multiple diagnostics and ranges it's interested in fixing in one call; that way the server could fix this.
Another-nother idea: editor provides a range, TypeScript just tries to fix all error codes.
Another-nother-nother idea: because error spans can drift, it might be better to just ask for the error code.
But overall, we need to get a better idea from how editors have implemented this.
There might be some inspiration from how refactorings work.
- addedDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.
on Oct 16, 2025 RyanCavanaugh commented
on Dec 3, 2025 MemberMore actionsClosing language service bugs related to the 6.0 implementation. For more information, see #62827
- locked as resolved and limited conversation to collaborators
on Dec 3, 2025

I believe that "misspelled identifier" quick fixes should precede the "remove unused declarations".
If anyone wants to take this on, this should just be a matter of