Repository navigation
Crash when find-all-references/rename finds no references #49217
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: LS: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Relates to go-to-definition, find-all-references, highlighting/occurrences.Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
/**/(yes, this is a blank file)
const s: string = "some /**/ string";const obj = {}/**/;Request find-all-references at any /**/.
Expected: Gracefully return no results
Actual:
Debug Failure. False expression.
at getPerProjectReferences (tsserverlibrary.js:175187:26)
at getReferencesWorker (tsserverlibrary.js:174990:37)
at Session.getReferences (tsserverlibrary.js:176595:34)
at _a.<computed> (tsserverlibrary.js:175434:61)
at <anonymous> (tsserverlibrary.js:177566:88)
at Session.executeWithRequestId (tsserverlibrary.js:177557:28)
at Session.executeCommand (tsserverlibrary.js:177566:33)
at unknown (suppressed.js:6:28)
at unknown (suppressed.js:41:45)
at unknown (suppressed.js:137:18)
Similar call stack if you try to rename in this example
const s: string = "some /**/ string";Debug Failure. False expression.
at getPerProjectReferences (tsserverlibrary.js:175187:26)
at getRenameLocationsWorker (tsserverlibrary.js:174964:37)
at Session.getRenameLocations (tsserverlibrary.js:176563:33)
at _a.<computed> (tsserverlibrary.js:175440:61)
at <anonymous> (tsserverlibrary.js:177566:88)
at Session.executeWithRequestId (tsserverlibrary.js:177557:28)
at Session.executeCommand (tsserverlibrary.js:177566:33)
at unknown (suppressed.js:6:28)
at unknown (suppressed.js:41:45)
at unknown (suppressed.js:39:18)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: LS: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Relates to go-to-definition, find-all-references, highlighting/occurrences.Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Activity
DanielRosenwasser commentedon May 23, 2022
Likely introduced by #48619
amcasey commentedon May 23, 2022
I was suspicious when I didn't need to make the same fix as for 4.7 (not assuming the list had elements), but the regression test passed. Looks like I need to add another one. 😄
amcasey commentedon May 23, 2022
Well, fourslash tests for all three pass. Time to repro manually, I guess.
DanielRosenwasser commentedon May 23, 2022
IIRC, when I searched for these functions, they were only visible to me in
tsserverlibrary.js, nottsserver.js. I assume it has something to do with the session implementation. But that doesn't make much sense to me given the fact that I could repro in tsserver.DanielRosenwasser commentedon May 24, 2022
typescript@4.8.0-dev.20220523givesHandle the case where the FAR results map is empty
Handle the case where the FAR results map is empty (#49254)