Skip to content

Language server debug failure - Did not expect GetAccessor to have an Identifier in its triviaΒ #50415

@TheWyo

Description

@TheWyo

Bug Report

πŸ”Ž Search Terms

  • auto complete
  • suggestions
  • snippets
  • language server

πŸ•— Version & Regression Information

  • This changed between versions 4.6.3 and 4.6.4

⏯ Playground Link

N/A, requires npm dependency

πŸ’» Code

Code sample unfortunately uses an external library as I've not been able to nail down an exact repro, but this issue only seems to occur in >=4.6.4 so I think this is less likely to be a purely type definition issue. Also reproduces in the latest dev version (at posting, 4.9.0-dev.20220823). I've also seen this error with SetAccessor instead of GetAccessor in similar situations.

Repro steps

  1. New project/workspace in vscode
  2. npm init -y.
  3. npm i @pixi/display@6.5.1
  4. npm i -D typescript@4.6.3
  5. Create the following file as src/index.ts:
import { DisplayObject } from "@pixi/display";

class A extends DisplayObject
{
	
}
  1. Place cursor within the class definition
  2. CTRL+Space to get suggestions/auto complete/snippets
  3. Change TS version to 4.6.4, repeat steps 6 & 7.
  4. No suggestions/auto complete/snippets this time.

πŸ™ Actual behavior

No suggestions/snippets provided, extension host log contains the following:

[2022-08-23 11:55:41.066] [exthost] [error] Error: <semantic> TypeScript Server Error (4.9.0-dev.20220823)
Debug Failure. Did not expect GetAccessor to have an Identifier in its trivia
Error: Debug Failure. Did not expect GetAccessor to have an Identifier in its trivia
    at addSyntheticNodes (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:166443:30)
    at processNode (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:166416:13)
    at visitNode (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:30934:24)
    at forEachChildInGetAccessor (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:31105:17)
    at Object.forEachChild (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:31714:47)
    at NodeObject.forEachChild (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:166397:23)
    at createChildren (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:166431:14)
    at NodeObject.getChildren (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:166374:56)
    at find (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:129452:30)
    at Object.findPrecedingToken (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:129445:22)
    at formatSpanWorker (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:149386:44)
    at d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:149309:140
    at Object.getFormattingScanner (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:147936:23)
    at Object.formatNodeGivenIndentation (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:149309:31)
    at d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134870:42
    at Object.flatMap (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:524:25)
    at Object.printAndFormatSnippetList (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134868:34)
    at getEntryForMemberCompletion (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134672:42)
    at createCompletionEntry (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134492:23)
    at getCompletionEntriesFromSymbols (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134997:29)
    at completionInfoFromData (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134304:31)
    at Object.getCompletionsAtPosition (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:134164:36)
    at Object.getCompletionsAtPosition (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:167677:35)
    at IpcIOSession.Session.getCompletions (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:179809:64)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:178482:61)
    at d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:180542:96
    at IpcIOSession.Session.executeWithRequestId (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:180533:28)
    at IpcIOSession.Session.executeCommand (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:180542:41)
    at IpcIOSession.Session.onMessage (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:180570:35)
    at process.<anonymous> (d:\Temp\snippetbugtest\node_modules\typescript\lib\tsserver.js:184736: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)
	at Function.create (c:\Users\Russell.Speke\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:509517)
	at dispatchResponse (c:\Users\Russell.Speke\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:503365)
	at dispatchMessage (c:\Users\Russell.Speke\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:502233)
	at ChildProcess.<anonymous> (c:\Users\Russell.Speke\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:501718)
	at ChildProcess.emit (node:events:390:28)
	at emit (node:internal/child_process:917:12)
	at processTicksAndRejections (node:internal/process/task_queues:84:21)

πŸ™‚ Expected behavior

Auto complete/snippets etc should work as normal.

Metadata

Metadata

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