-
Notifications
You must be signed in to change notification settings - Fork 164
Language server 3.3.0 crashes on a textDocument/codeAction request #694
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
Comments
It doesn't reproduce here. Can you provide LSP logs from your editor since starting TLS? |
Full log of server communications? |
Thanks. I can't immediately reproduce but maybe it needs more investigation... But I can see that the log is very big with a lot of things going on before the crash. Are you able to reproduce consistently with just one file open and directly after server is started? |
|
That's the same log. BTW. Why is it using global typescript instead of the one in the project? Do you have dependencies installed in that project?
|
That's not the same log. |
Even if not the same, it's still not much different in terms of simplicity. There is still a to of hover and definition requests. Are those required to reproduce the issue? |
No. Now I disable all features except inspection. |
Right, I can reproduce now. One has to request code actions for that code that has error diagnostics due to unfinished That said, it's not a server crash but just an error response for the code action request. That typically doesn't have any noticeable implications for the user since such errors are typically not surfaced to the UI. Or at least I think they shouldn't be. Is that not the case in IntelliJ? Previously the server was catching many requests so those were silent errors. I've assumed that it's fine to surface any such errors on the LSP level. That means that we can see issues in Typescript and can potentially report them in the Typescript repo. I'm open to changing it back if it causes problems though. |
Hi there, |
Maybe it's just a matter of returning better error code. I will look at it at some point. |
I've isolated the request in question in case it helps: |
Regarding emacs' error message:
I'm not sure what that means exactly. Server is reporting a |
I switched on logging the comms between lsp-mode and the language server again. For the request, see above. The exact response is: https://gist.github.com/chemicalderrick/5c3d274fe544f949e471bd0ce14e2c0b I just tested downgrading to typescript-language-server@3.2.0 and no error could be found. Neither in the language server's stderr, emacs' message buffer or in the communications protocol. Proper suggestions for fixing the issues presented by lsp-mode were provided: |
Now I see that that specific error code is reserved for RPC communication. Server should use range between -32899 and -32800. Maybe lsp-mode won't open the panel on those but no guarantees from me. |
I've released new version that doesn't report errors using internal error code. Not sure if that will help at all but feel free to let me know. |
I'm afraid not. lsp-mode continues to report this as "Error from the Language Server: TypeScript Server Error (4.9.5)", not very useful. Stack trace is the same as before and I've logged the communication again 8000 if it helps. https://gist.github.com/chemicalderrick/d2259ef25ffb98bf2c98289389113c4c |
Do you still experience that with the latest version? I've recently fixed an issue that made the server crash on receiving an error from Typescript (#805). |
The issue I had seems to have been resolved, thank you. |
Thanks. Lets hope it's resolved then. |
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request textDocument/codeAction failed with message: TypeScript Server Error (4.9.5)
Cannot read properties of undefined (reading 'heritageClauses')
TypeError: Cannot read properties of undefined (reading 'heritageClauses')
at getNodes (/usr/lib/node_modules/typescript/lib/tsserver.js:159276:63)
at Object.getCodeActions (/usr/lib/node_modules/typescript/lib/tsserver.js:159260:29)
at /usr/lib/node_modules/typescript/lib/tsserver.js:153574:77
at Object.flatMap (/usr/lib/node_modules/typescript/lib/tsserver.js:524:25)
at Object.getFixes (/usr/lib/node_modules/typescript/lib/tsserver.js:153574:23)
at /usr/lib/node_modules/typescript/lib/tsserver.js:169473:35
at Object.flatMap (/usr/lib/node_modules/typescript/lib/tsserver.js:524:25)
at Object.getCodeFixesAtPosition (/usr/lib/node_modules/typescript/lib/tsserver.js:169471:23)
at Session.getCodeFixes (/usr/lib/node_modules/typescript/lib/tsserver.js:181721:64)
at Session.handlers.ts.Map.ts.getEntries._a. (/usr/lib/node_modules/typescript/lib/tsserver.js:180100:61)
at /usr/lib/node_modules/typescript/lib/tsserver.js:182034:96
at Session.executeWithRequestId (/usr/lib/node_modules/typescript/lib/tsserver.js:182025:28)
at Session.executeCommand (/usr/lib/node_modules/typescript/lib/tsserver.js:182034:41)
at Session.onMessage (/usr/lib/node_modules/typescript/lib/tsserver.js:182062:35)
at process. (/usr/lib/node_modules/typescript/lib/tsserver.js:186218:31)
at process.emit (node:events:513:28)
at emit (node:internal/child_process:937:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
The text was updated successfully, but these errors were encountered: