-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 outputDomain: LS: Organize ImportsIssues with the organize imports featureIssues with the organize imports featureFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Additional repros can be found in #59085
Error: Debug Failure. False expression.
Req #3028 - organizeImports
at Object.resetTokenState (/typescript-5.6.0-dev.20240630/lib/typescript.js:14395:11)
at addSyntheticNodes (/typescript-5.6.0-dev.20240630/lib/typescript.js:148143:11)
at createSyntaxList (/typescript-5.6.0-dev.20240630/lib/typescript.js:148171:3)
at processNodes (/typescript-5.6.0-dev.20240630/lib/typescript.js:148132:19)
at visitNodes (/typescript-5.6.0-dev.20240630/lib/typescript.js:31622:14)
at forEachChildInMappedType (/typescript-5.6.0-dev.20240630/lib/typescript.js:31760:208)
at forEachChild (/typescript-5.6.0-dev.20240630/lib/typescript.js:32138:35)
at NodeObject.forEachChild (/typescript-5.6.0-dev.20240630/lib/typescript.js:148112:12)
at createChildren (/typescript-5.6.0-dev.20240630/lib/typescript.js:148137:8)
at NodeObject.getChildren (/typescript-5.6.0-dev.20240630/lib/typescript.js:148091:59)
at getTokenAtPositionWorker (/typescript-5.6.0-dev.20240630/lib/typescript.js:136484:32)
at getTouchingToken (/typescript-5.6.0-dev.20240630/lib/typescript.js:136457:10)
at getTouchingPropertyName (/typescript-5.6.0-dev.20240630/lib/typescript.js:136454:10)
at /typescript-5.6.0-dev.20240630/lib/typescript.js:169040:33
at mapDefined (/typescript-5.6.0-dev.20240630/lib/typescript.js:2571:22)
at getPossibleSymbolReferenceNodes (/typescript-5.6.0-dev.20240630/lib/typescript.js:169039:12)
at eachSymbolReferenceInFile (/typescript-5.6.0-dev.20240630/lib/typescript.js:168986:25)
at Object.isSymbolReferencedInFile (/typescript-5.6.0-dev.20240630/lib/typescript.js:168980:12)
at isDeclarationUsed (/typescript-5.6.0-dev.20240630/lib/typescript.js:171956:221)
at /typescript-5.6.0-dev.20240630/lib/typescript.js:171931:66
at removeUnusedImports (/typescript-5.6.0-dev.20240630/lib/typescript.js:171931:52)
at processImportsOfSameModuleSpecifier (/typescript-5.6.0-dev.20240630/lib/typescript.js:171819:39)
at /typescript-5.6.0-dev.20240630/lib/typescript.js:171787:175
at flatMap (/typescript-5.6.0-dev.20240630/lib/typescript.js:2501:17)
at organizeDeclsWorker (/typescript-5.6.0-dev.20240630/lib/typescript.js:171787:28)
at organizeImportsWorker (/typescript-5.6.0-dev.20240630/lib/typescript.js:171824:5)
at /typescript-5.6.0-dev.20240630/lib/typescript.js:171766:57
at Object.organizeImports (/typescript-5.6.0-dev.20240630/lib/typescript.js:171766:28)
at Object.organizeImports2 [as organizeImports] (/typescript-5.6.0-dev.20240630/lib/typescript.js:149686:39)
at IOSession.organizeImports (/typescript-5.6.0-dev.20240630/lib/typescript.js:191237:50)
at organizeImports (/typescript-5.6.0-dev.20240630/lib/typescript.js:189388:43)
at /typescript-5.6.0-dev.20240630/lib/typescript.js:191603:15
at IOSession.executeWithRequestId (/typescript-5.6.0-dev.20240630/lib/typescript.js:191592:14)
at IOSession.executeCommand (/typescript-5.6.0-dev.20240630/lib/typescript.js:191601:29)
at IOSession.onMessage (/typescript-5.6.0-dev.20240630/lib/typescript.js:191649:68)
at Interface.<anonymous> (/typescript-5.6.0-dev.20240630/lib/tsserver.js:501:14)
Affected repos
tldraw/tldraw
Raw error text:RepoResults2/tldraw.tldraw.rawError.txt in the artifact folder Replay commands:
RepoResults2/tldraw.tldraw.replay.txt in the artifact folder
Last few requests
{"seq":3025,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/packages/tlschema/src/shapes/TLArrowShape.ts","line":208,"offset":1}}
{"seq":3026,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/tlschema/src/shapes/TLEmbedShape.ts"],"openFiles":[]}}
{"seq":3027,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/tlschema/src/records/TLShape.ts","projectRootPath":"@PROJECT_ROOT@"}]}}
{"seq":3028,"type":"request","command":"organizeImports","arguments":{"scope":{"type":"file","args":{"file":"@PROJECT_ROOT@/packages/tlschema/src/records/TLShape.ts"}},"skipDestructiveCodeActions":false}}
Repro steps
#!/bin/bash
git clone https://github.com/tldraw/tldraw --recurse-submodules
git -C "./tldraw" reset --hard 4fff8a89afc03c91ad928b708caa677887f12226
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/162530/artifacts?artifactName=RepoResults2&api-version=7.0" | jq -r ".resource.downloadUrl")
wget -O RepoResults2.zip "$downloadUrl"
unzip -p RepoResults2.zip RepoResults2/tldraw.tldraw.replay.txt > tldraw.tldraw.replay.txt
npm install --no-save @typescript/server-replayTo run the repro:
# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./tldraw ./tldraw.tldraw.replay.txt <PATH_TO_tsserver.js>Originally posted by @typescript-bot in #59085 (comment)
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 outputDomain: LS: Organize ImportsIssues with the organize imports featureIssues with the organize imports featureFix AvailableA PR has been opened for this issueA PR has been opened for this issue