kotlin-language-server icon indicating copy to clipboard operation
kotlin-language-server copied to clipboard

Use official LSP method to fetch content from custom KLS URIs

Open fwcd opened this issue 6 years ago • 1 comments
trafficstars

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.

fwcd avatar Sep 07 '19 23:09 fwcd

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.

fwcd avatar Aug 22 '24 16:08 fwcd