kotlin-language-server
kotlin-language-server copied to clipboard
Use official LSP method to fetch content from custom KLS URIs
Since support for the kls URI scheme (#150) was introduced, the language server has been using the the non-standard protocol method kotlin/jarClassContents to provide source file contents for classes inside JAR archives. This is clearly not ideal, since the one of the main goals of LSP is to provide editor-agnostic support for features such as Go-To-Definition. To work around this issue, the language server has been using temporary files if the editor does not support the kls URI scheme.
There is, however, a new in-progress API (https://github.com/microsoft/language-server-protocol/issues/336) that standardizes this method and we should adopt it once it gets implemented.
Seems to have been officially upstreamed as workspace/textDocumentContent in LSP 3.18:
- https://github.com/microsoft/language-server-protocol/pull/1994
Once LSP4J implements this, we could migrate our non-standard request to this.