Skip to content

Crash when find-all-references/rename finds no references #49217

Closed

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)

Activity

  1. added
    BugA bug in TypeScript
    CrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
    Domain: LS: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.
    on May 23, 2022
  2. DanielRosenwasser commented on May 23, 2022

    @DanielRosenwasser
    MemberAuthor

    Likely introduced by #48619

  3. amcasey commented on May 23, 2022

    @amcasey
    Member

    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. 😄

  4. amcasey commented on May 23, 2022

    @amcasey
    Member

    Well, fourslash tests for all three pass. Time to repro manually, I guess.

  5. DanielRosenwasser commented on May 23, 2022

    @DanielRosenwasser
    MemberAuthor

    IIRC, when I searched for these functions, they were only visible to me in tsserverlibrary.js, not tsserver.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.

  6. DanielRosenwasser commented on May 24, 2022

    @DanielRosenwasser
    MemberAuthor

    typescript@4.8.0-dev.20220523 gives

    <semantic> Response received: references (9). Request took 34 ms. Success: false . Message: Error processing request. Debug Failure. False expression.
    Error: Debug Failure. False expression.
        at getPerProjectReferences (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:175031:26)
        at getReferencesWorker (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:174834:37)
        at IpcIOSession.Session.getReferences (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:176439:34)
        at Session.handlers.ts.Map.ts.getEntries._a.<computed> (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:175278:61)
        at .../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:177410:88
        at IpcIOSession.Session.executeWithRequestId (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:177401:28)
        at IpcIOSession.Session.executeCommand (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:177410:33)
        at IpcIOSession.Session.onMessage (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:177436:35)
        at process.<anonymous> (.../ms-vscode.vscode-typescript-next-4.8.20220523/node_modules/typescript/lib/tsserver.js:180071:31)
        at process.emit (node:events:390:28)
        at emit (node:internal/child_process:917:12)
        at processTicksAndRejections (node:internal/process/task_queues:84:21)
    
  7. added a commit that references this issue on May 26, 2022
    b412ee2
  8. added a commit that references this issue on May 26, 2022
    8497483
  9. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptCrashFor 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.Fix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions