-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Milestone
Description
Bug Report
Encountered a problem while working with TypeScript on VSCode. The problem is pretty obscure, but it can be reproduced by following these instructions
- Clone this repository: https://github.com/sirikon-experiments/tsserver-bug
- Inside the repository, with NodeJS 18.12.1, run
npm install
- Open VSCode on the repository
- Open
src/helper.ts
and keep it in a tab, don't close it. - Open
src/main.ts
, place the cursor overlogContents
on line 5 and hitCtrl + .
(Or whatever key combination you use for opening quick fixes).
5.1. It displaysNo code actions available
. - Open
src/models.ts
and comment half of the defined keys in the file, lines 15 to 29 for example. - Go back to
src/main.ts
and try again opening the quick fixes overlogContents
as before.
7.1. It displays the quick fixes properly, recommendingAdd import from "./helper"
- Uncommenting lines 15 to 29 in
src/models.ts
makes the quick fixes disappear again. Another way to make it work insrc/main.ts
is to changelogContents(data);
tologContents();
and ask for quick fixes again. - In VSCode:
Ctrl + Shift + P
->TypeScript: Open TS Server Log
-> You'll see errors like these:
Debug Failure. False expression: Token end is child end
Error: Debug Failure. False expression: Token end is child end
at processChildNode (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:150867:38)
at /home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:150803:21
at visitNode (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:31215:24)
at forEachChildInPropertySignature (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:31310:17)
at Object.forEachChild (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:31998:47)
at processNode (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:150802:20)
at processChildNode (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:150874:21)
at processChildNodes (/home/sirikon/repos/tsserver-bug/node_modules/typescript/lib/tsserver.js:150929:48)
🔎 Search Terms
"Debug Failure. False expression: Token end is child end"
🕗 Version & Regression Information
Happens, at least, on versions 4.9.4
and 4.9.3
, didn't try more versions for now.
🙁 Actual behavior
Given the instructions, the presented scenario results in errors when tsserver is asked for code fixes, but it should work as expected, as everything else.
🙂 Expected behavior
Given the instructions, quick fixes should work always regardless of the amount of keys in a model.
VictorGlindasPaf
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output