Skip to content

Completions error when completing a string in parentheses #52874

@DanielRosenwasser

Description

@DanielRosenwasser
declare let x: "foo" | "bar";

switch (x) {
    case ("/**/")
}

Request completions at /**/.

Expected: string literals "foo" and "bar" should be provided as completion items.
Actual: Error!

TypeError: clauses is not iterable
    at newCaseClauseTracker (tsserver.js:130163:24)
    at getStringLiteralCompletionEntries (tsserver.js:151930:23)
    at Object.getStringLiteralCompletions (tsserver.js:151741:21)
    at Object.getCompletionsAtPosition (tsserver.js:148418:70)
    at Object.getCompletionsAtPosition2 [as getCompletionsAtPosition] (tsserver.js:135546:35)
    at IpcIOSession.getCompletions (tsserver.js:179105:54)
    at completionInfo (tsserver.js:177516:43)
    at tsserver.js:179869:69
    at IpcIOSession.executeWithRequestId (tsserver.js:179861:14)
    at IpcIOSession.executeCommand (tsserver.js:179869:29)
    at IpcIOSession.onMessage (tsserver.js:179911:51)
    at process.<anonymous> (tsserver.js:181479:14)

Found on mattermost/focalboard in this crawler run.

https://github.com/mattermost/focalboard/blob/6576d75192de418ff73a460740ee777de75cab8d/webapp/src/components/calculations/calculations.ts#L21-L37

Metadata

Metadata

Assignees

No one assigned

    Labels

    Crawler-DetectedDetected by a crawler running random TSServer operations on public code.Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".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