| Summary: | Crash while using Go to Definition in LSP Client with svelte-language-server | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Grósz Dániel <groszdanielpub> |
| Component: | general | Assignee: | Mark Nauwelaerts <mark.nauwelaerts> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | christoph |
| Priority: | NOR | ||
| Version First Reported In: | 20.08.1 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/utilities/kate/commit/98876895d629baa573e50f9337ec4e06ed0f9c6d | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: |
Open files and Backtrace
LSP's input LSP's output |
||
|
Description
Grósz Dániel
2020-10-02 23:27:34 UTC
Git commit ea4fe985c9123adc3f67d07c1ae60bac4da52813 by Christoph Cullmann. Committed on 03/10/2020 at 15:07. Pushed by cullmann into branch 'master'. ensure that even if the url is empty, we create some parent to avoid accessing nullptr parent M +2 -1 addons/lspclient/lspclientpluginview.cpp https://invent.kde.org/utilities/kate/commit/ea4fe985c9123adc3f67d07c1ae60bac4da52813 Thanks for well done report, the back trace was very useful. If you can, you could try to test a kate master branch version with this fix. See https://kate-editor.org/build-it/ Created attachment 132105 [details]
LSP's input
Created attachment 132106 [details]
LSP's output
Thank you, it doesn't crash anymore. However, it still doesn't actually go to the definition: it does nothing. I attach the language server's input and output after I try to go to the definition of 'constant' in 'import.html' (from the earlier attachment). I'm not familiar with the language server protocol, so I don't know if the server's reply is conformant, but it seems to contain the relevant information. Should I open a separate bug report for this one? Perhaps Mark has some idea for that. But good that it at least no longer crashs, that shouldn't happen with any input, sorry that we had that :/ Let's reopen the bug until that is clarified. Git commit 229443cc15e61fd23e5d616a46cdc3b36bb1d128 by Christoph Cullmann. Committed on 04/10/2020 at 13:44. Pushed by cullmann into branch 'release/20.08'. ensure that even if the url is empty, we create some parent to avoid accessing nullptr parent (cherry picked from commit ea4fe985c9123adc3f67d07c1ae60bac4da52813) M +2 -1 addons/lspclient/lspclientpluginview.cpp https://invent.kde.org/utilities/kate/commit/229443cc15e61fd23e5d616a46cdc3b36bb1d128 Oops, the crash is obviously bad, but is fortunately plugged now. As for it not working (and the Url turning empty), that is actually a server-side problem. As specified (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition) the reply to a 'textDocument/definition') can be one of Location, or Location[] or LocationLink[]. However, the latter depends on the client specifying it is so capable (which allows extending the protocol without surprising existing client). As it stands, the client does not support that reply nor does it claim to in reported capabilities, so the server should not resort to sending that type of reply. It's not difficult to extend parsing to handle that reply as well (and will likely do so in the coming days), but such is the background of the situation. (In reply to Mark Nauwelaerts from comment #8) > As for it not working (and the Url turning empty), that is actually a > server-side problem. Thank you for looking at it, I've reported it to the server project ( https://github.com/sveltejs/language-tools/issues/592 ). Git commit 98876895d629baa573e50f9337ec4e06ed0f9c6d by Mark Nauwelaerts. Committed on 06/10/2020 at 17:46. Pushed by mnauwelaerts into branch 'master'. lspclient: also secretly accept LocationLink in some replies M +22 -1 addons/lspclient/lspclientserver.cpp https://invent.kde.org/utilities/kate/commit/98876895d629baa573e50f9337ec4e06ed0f9c6d The above commit adds some additional (fallback) parsing client-side, so it should be able to handle the response now. |