Skip to content

Incorrect assertion for "bad syntax kind" in unused parameter codefix #47787

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Repro of #43532

let x = {
    get yadda(/**/param) {
    }
}

Request code fixes at /**/ for "fix unused parameter".

<semantic> Response received: getCodeFixes (1390). Request took 1 ms. Success: false . Message: Error processing request. Debug Failure. Unexpected node.
Node GetAccessor was unexpected.
Error: Debug Failure. Unexpected node.
Node GetAccessor was unexpected.
    at mayDeleteParameter ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:151086:37)
    at tryDeleteParameter ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:151023:17)
    at tryDeleteDeclarationWorker ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:151013:17)
    at tryDeleteDeclaration ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:150999:13)
    at [WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:150864:32
    at Function.ChangeTracker.with ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:144342:17)
    at Object.getCodeActions ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:150863:69)
    at [WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:145528:77
    at Object.flatMap ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:522:25)
    at Object.getFixes ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:145528:23)
    at [WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:160396:35
    at Object.flatMap ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:522:25)
    at Object.getCodeFixesAtPosition ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:160394:23)
    at IOSession.Session.getCodeFixes ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:171882:64)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:170518:61)
    at [WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:172195:88
    at IOSession.Session.executeWithRequestId ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:172186:28)
    at IOSession.Session.executeCommand ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:172195:33)
    at IOSession.Session.onMessage ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:172221:35)
    at Interface.<anonymous> ([WORKSPACE_DIR]\node_modules\typescript\lib\tsserver.js:174826:31)
    at Interface.emit (events.js:315:20)
    at Interface._onLine (readline.js:337:10)
    at Interface._normalWrite (readline.js:482:12)
    at Socket.ondata (readline.js:194:10)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: Quick FixesEditor-provided fixes, often called code actions.Effort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Help WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions