Open dvdplm opened 6 years ago
It is definitely in scope, but not planned in the near future (priority is a stable 1.0 release, rather than feature work). If you'd like to try and implement, I'm happy to help however is useful.
I know roughly how to do this, but I never contributed to such an extension project and I do not really know typescript. I can give it a try though.
Ok, I did a first (incomplete) implementation: https://github.com/Boiethios/rls-vscode. The issue is that when I ship my own folding, it disable the previous one.
Does someone know how this works? I guess that vscode has its own default folding implementation overridden by another one. In this case, a clean and fast solution, IMHO, would be to implement the folding in RLS and call the function from the extension, just like some other functionality of the extension.
Does someone know how this works? I guess that vscode has its own default folding implementation overridden by another one.
That sounds right to me - it's often how VSCode works.
would be to implement the folding in RLS and call the function from the extension
is there support for this in the LSP? If so, this seems like a great idea. If not we'd have to think what the API looks like and whether it is worth adding another custom protocol element.
Is there support for this in the LSP? If so, this seems like a great idea. If not we'd have to think what the API looks like and whether it is worth adding another custom protocol element.
It seems that nobody implemented this yet: https://docs.rs/lsp/0.3.1/lsp/index.html?search=fold
I guess that it will be useful to add another protocol element.
@nrc @Boiethios @dvdpl Asking for a friend ;): how is code folding implemented in VSCode nowadays?
I'd like to replicate the feature in Eclipse Corrosion.
Document folding is now implemented in the LSP 3.10, which should be implemented by the RLS to be reused by other clients out there. https://github.com/Microsoft/language-server-protocol/issues/418
VSCode recently gained the ability to do language-specific code folding. This is interesting for Rust for things like folding lists of
extern crate
,use
, license headers and doc comments (which often take up a lot of space).Is this in-scope for
rls-vscode
? Is it planned? It'd be very useful! :)