Skip to content

Errant case causes crash in switch/case snippet completions #55946

@DanielRosenwasser

Description

@DanielRosenwasser
switch (Math.random() ? 123 : 456) {
     case "oops!":
     case$
}

Ensure you have snippet completions enabled and request completions at $.

Request completion entry details for the snippet completion case 123...

TypeError: Cannot destructure property 'entry' of 'getExhaustiveCaseSnippets(...)' as it is undefined.
    at Object.getCompletionEntryDetails (.../node_modules/typescript/lib/tsserver.js:158306:15)
    at Object.getCompletionEntryDetails2 [as getCompletionEntryDetails] (.../node_modules/typescript/lib/tsserver.js:144582:35)
    at .../node_modules/typescript/lib/tsserver.js:184151:43
    at mapDefined (.../node_modules/typescript/lib/tsserver.js:2668:22)
    at IpcIOSession.getCompletionEntryDetails (.../node_modules/typescript/lib/tsserver.js:184149:20)
    at completionEntryDetails (.../node_modules/typescript/lib/tsserver.js:182478:43)
    at .../node_modules/typescript/lib/tsserver.js:184857:69
    at IpcIOSession.executeWithRequestId (.../node_modules/typescript/lib/tsserver.js:184849:14)
    at IpcIOSession.executeCommand (.../node_modules/typescript/lib/tsserver.js:184857:29)
    at IpcIOSession.onMessage (.../node_modules/typescript/lib/tsserver.js:184899:51)
    at process.<anonymous> (.../node_modules/typescript/lib/tsserver.js:186480:14)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions