Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get "Move to a new file" code action working. #216

Open
Nirajgns opened this issue Dec 21, 2024 · 3 comments
Open

Cant get "Move to a new file" code action working. #216

Nirajgns opened this issue Dec 21, 2024 · 3 comments

Comments

@Nirajgns
Copy link

Nirajgns commented Dec 21, 2024

every time i hit move to a new file, i get this error:

-32603: Request codeAction/resolve failed with message: TypeScript Server Error (5.6.2)
Debug Failure.
Error: Debug Failure.
at Object.addImportFromExportedSymbol (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:155208:32)
at /home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:145116:19
at Map.forEach ()
at addTargetFileImports (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:145110:17)
at getNewStatementsAndRemoveFromOldFile (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:144331:3)
at doChange4 (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:145334:3)
at /home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:145323:77
at _ChangeTracker.with (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:175532:5)
at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:145323:60)
at Object.getEditsForRefactor (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:143422:31)
at Object.getEditsForRefactor2 [as getEditsForRefactor] (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:150903:32)
at IpcIOSession.getEditsForRefactor (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:192236:49)
at getEditsForRefactor (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:190435:43)
at /home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:192655:15
at IpcIOSession.executeWithRequestId (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:192644:14)
at IpcIOSession.executeCommand (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:192653:29)
at IpcIOSession.onMessage (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/typescript.js:192701:68)
at process. (/home/niraj/.local/share/nvim/mason/packages/vtsls/node_modules/@vtsls/language-server/node_modules/typescript/lib/tsserver.js:525:14)
at process.emit (node:events:519:28)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

@yioneko
Copy link
Owner

yioneko commented Dec 30, 2024

Seems identical: microsoft/TypeScript#59650. Does this happen after upgrade to typescript 5.7?

@akomm
Copy link

akomm commented Jan 29, 2025

Nope, tested with 5.7.3:

2025-01-29 10:58:31.188 [error] <semantic> TypeScript Server Error (5.7.3)
Debug Failure. False expression: Expected symbol to be a module
Error: Debug Failure. False expression: Expected symbol to be a module
    at Object.addImportForModuleSymbol (xyz/node_modules/typescript/lib/typescript.js:156990:11)
    at xyz/node_modules/typescript/lib/typescript.js:146715:19
    at Map.forEach (<anonymous>)
    at addTargetFileImports (xyz/node_modules/typescript/lib/typescript.js:146708:17)
    at getNewStatementsAndRemoveFromOldFile (xyz/node_modules/typescript/lib/typescript.js:145939:3)
    at doChange4 (xyz/node_modules/typescript/lib/typescript.js:146935:3)
    at xyz/node_modules/typescript/lib/typescript.js:146924:77
    at _ChangeTracker.with (xyz/node_modules/typescript/lib/typescript.js:177632:5)
    at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (xyz/node_modules/typescript/lib/typescript.js:146924:60)
    at Object.getEditsForRefactor (xyz/node_modules/typescript/lib/typescript.js:145029:31)
    at Object.getEditsForRefactor2 [as getEditsForRefactor] (xyz/node_modules/typescript/lib/typescript.js:152529:32)
    at IpcIOSession.getEditsForRefactor (xyz/node_modules/typescript/lib/typescript.js:194809:49)
    at getEditsForRefactor (xyz/node_modules/typescript/lib/typescript.js:192960:43)
    at xyz/node_modules/typescript/lib/typescript.js:195231:15
    at IpcIOSession.executeWithRequestId (xyz/node_modules/typescript/lib/typescript.js:195220:14)
    at IpcIOSession.executeCommand (xyz/node_modules/typescript/lib/typescript.js:195229:29)
    at IpcIOSession.onMessage (xyz/node_modules/typescript/lib/typescript.js:195277:68)
    at process.<anonymous> (xyz/node_modules/typescript/lib/_tsserver.js:525:14)
    at process.emit (node:events:518:28)
    at emit (node:internal/child_process:950:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21): Error: <semantic> TypeScript Server Error (5.7.3)
Debug Failure. False expression: Expected symbol to be a module
Error: Debug Failure. False expression: Expected symbol to be a module
    at Object.addImportForModuleSymbol (xyz/node_modules/typescript/lib/typescript.js:156990:11)
    at xyz/node_modules/typescript/lib/typescript.js:146715:19
    at Map.forEach (<anonymous>)
    at addTargetFileImports (xyz/node_modules/typescript/lib/typescript.js:146708:17)
    at getNewStatementsAndRemoveFromOldFile (xyz/node_modules/typescript/lib/typescript.js:145939:3)
    at doChange4 (xyz/node_modules/typescript/lib/typescript.js:146935:3)
    at xyz/node_modules/typescript/lib/typescript.js:146924:77
    at _ChangeTracker.with (xyz/node_modules/typescript/lib/typescript.js:177632:5)
    at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (xyz/node_modules/typescript/lib/typescript.js:146924:60)
    at Object.getEditsForRefactor (xyz/node_modules/typescript/lib/typescript.js:145029:31)
    at Object.getEditsForRefactor2 [as getEditsForRefactor] (xyz/node_modules/typescript/lib/typescript.js:152529:32)
    at IpcIOSession.getEditsForRefactor (xyz/node_modules/typescript/lib/typescript.js:194809:49)
    at getEditsForRefactor (xyz/node_modules/typescript/lib/typescript.js:192960:43)
    at xyz/node_modules/typescript/lib/typescript.js:195231:15
    at IpcIOSession.executeWithRequestId (xyz/node_modules/typescript/lib/typescript.js:195220:14)
    at IpcIOSession.executeCommand (xyz/node_modules/typescript/lib/typescript.js:195229:29)
    at IpcIOSession.onMessage (xyz/node_modules/typescript/lib/typescript.js:195277:68)
    at process.<anonymous> (xyz/node_modules/typescript/lib/_tsserver.js:525:14)
    at process.emit (node:events:518:28)
    at emit (node:internal/child_process:950:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
	at n.create (/usr/share/code/resources/app/extensions/typescript-language-features/dist/extension.js:1:486292)
	at y.dispatchResponse (/usr/share/code/resources/app/extensions/typescript-language-features/dist/extension.js:1:480262)
	at y.dispatchMessage (/usr/share/code/resources/app/extensions/typescript-language-features/dist/extension.js:1:479060)
	at ChildProcess.<anonymous> (/usr/share/code/resources/app/extensions/typescript-language-features/dist/extension.js:1:478553)
	at ChildProcess.emit (node:events:518:28)
	at emit (node:internal/child_process:950:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Image

@akomm
Copy link

akomm commented Jan 29, 2025

I do not know, why it expects the symbol to be a module. Might be related with ESM & specific tsconfig settings?

It is failing at moving "export async function foobar() { /* ...code */}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants