Skip to content

Code fix crash in JSDoc with strictPropertyInitialization #47417

@DanielRosenwasser

Description

@DanielRosenwasser
// @strictPropertyInitialization: true

////// @ts-check
////
////class C {
////    /** @type {string} */
////    foo;
////
////    constructor() {
////        
////    }
////}

Request code actions.

Response received: getCodeFixes (73). Request took 3 ms. Success: false . Message: Error processing request. Cannot read property 'kind' of undefined
TypeError: Cannot read property 'kind' of undefined
    at Object.isUnionTypeNode ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:27948:21)
    at addUndefinedType ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153377:28)
    at [USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153371:92
    at Function.ChangeTracker.with ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144341:17)
    at getActionForAddMissingUndefinedType ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153371:60)
    at Object.getCodeActions ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153326:21)
    at [USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:145527:77
    at Object.flatMap ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:522:25)
    at Object.getFixes ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:145527:23)
    at [USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160394:35
    at Object.flatMap ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:522:25)
    at Object.getCodeFixesAtPosition ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160392:23)
    at IOSession.Session.getCodeFixes ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:171880:64)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:170516:61)
    at [USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172193:88
    at IOSession.Session.executeWithRequestId ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172184:28)
    at IOSession.Session.executeCommand ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172193:33)
    at IOSession.Session.onMessage ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:172219:35)
    at Interface.<anonymous> ([USERDIR]\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:174824: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

Labels

BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: LS: 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".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