microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
99.06k stars 12.29k forks source link

move to new file code action results in TS server error #59118

Closed justschen closed 14 hours ago

justschen commented 2 days ago

https://github.com/microsoft/vscode/issues/219704

the move to new file code action no longer works. move to file works fine!

I see the following errors in the console:

 ERR <semantic> TypeScript Server Error (5.6.0-dev.20240618)
Debug Failure.
Error: Debug Failure.
    at Object.addImportFromExportedSymbol (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:154555:32)
    at /Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:144497:19
    at Map.forEach (<anonymous>)
    at addTargetFileImports (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:144491:17)
    at getNewStatementsAndRemoveFromOldFile (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:143731:3)
    at doChange4 (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:144697:3)
    at /Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:144686:77
    at _ChangeTracker.with (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:174647:5)
    at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:144686:60)
    at Object.getEditsForRefactor (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:142822:31)
    at Object.getEditsForRefactor2 [as getEditsForRefactor] (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:150250:32)
    at proxy.<computed> [as getEditsForRefactor] (/Users/justinq/Documents/GitHub/vscode/node_modules/tsec/lib/packages/tsec/utils.js:28:45)
    at IpcIOSession.getEditsForRefactor (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:191536:49)
    at getEditsForRefactor (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:189704:43)
    at /Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:191940:69
    at IpcIOSession.executeWithRequestId (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:191932:14)
    at IpcIOSession.executeCommand (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:191940:29)
    at IpcIOSession.onMessage (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/typescript.js:191981:51)
    at process.<anonymous> (/Users/justinq/Documents/GitHub/vscode/node_modules/typescript/lib/tsserver.js:511:14)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:951:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21): Error: <semantic> TypeScript Server Error (5.6.0-dev.20240618)

Additional information about the issue

We had previously discussed removing the move to new file all-together when talking about the improvements to how often move to file was coming up, wondering if it's related?

DanielRosenwasser commented 2 days ago

Lacking a repro (maybe @divmgl has one), I'm going to mark this as a duplicate of #58897.

typescript-bot commented 14 hours ago

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.