Open LukeMauldin opened 4 years ago
Well, folding in VSCode works for me.
What delimiters did you use to get code folding to work in VSCode?
I'm using the latest VSCode, latest RLS on stable-x86_64-pc-windows-msvc
and latest RLS for VSCode without any other special setup.
Can you paste a simple code example that demonstrates how it works? Do you use region tags? To clarify, I would like to be able to define my own regions. Is this possible?
Is code folding implemented in VSC or in RLS though?
Code folding is a VS Code feature, not RLS. However, I have been unable to get anything to work in the past with Rust.
Can you paste a simple code example that demonstrates how it works? Do you use region tags? To clarify, I would like to be able to define my own regions. Is this possible?
Something like that. Hovering over the gutter (to the right of the line numbers) reveals the folding arrows.
I understood that VSCode has its own "naive" folding functionality. It simply looks the indentation. It is universal, but it lacks syntax understanding.
Then VSCode has a FoldingRangeProvider API
to allow every language server to create syntax meaningful folding.
Inside the code https://github.com/rust-lang/rls/blob/master/rls/src/server/mod.rs on line 460:
folding_range_provider: None,
I suppose it means, that it is not implemented.
I would also like very much to have the // region: name, // endregion
folding.
It means a lot to me.
I wrote a proof of concept, that can be used to return a list of "folding regions" to VS from the language server. https://github.com/LucianoBestia/region_folding
Does the current version of rls support the Code Folding part of the LSP protocol?