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

imports folding like vscode-java

Open iykekings opened this issue 1 year ago • 1 comments

I can help conttribute to this if anyone is willing to give me some pointers on where/how to start.

iykekings avatar Jul 07 '22 14:07 iykekings

Hi! I am not entirely sure how vscode-java handles this, but I think it should be possible to implement this via the Kotlin grammar/syntax in this repo.

  • There are some docs here on how to write TextMate grammars (and in particular folding)
  • For development of this grammar, I recommend using the vscode-grammar-dev extension (should already be listed in the run/debug menu if you open this repo with VSCode).

If that turns out to be insufficient, we could also add support via LSP's folding range request. The language server of course has the advantage of having access to the full parse tree rather than just the tokenization rules defined by the syntax grammar, but in this case I think the grammar should be sufficient.

fwcd avatar Jul 08 '22 03:07 fwcd