-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable folding #772
Comments
This one should be straight forward.
I couldn't find documentation on this in LSP but I thought that overlapping ranges were not allowed (in vscode anyway) which poses a problem with this.
I think this would be better done by the client. The server just sends the ranges and the client can decide what to do about it. LSP has a
I wonder if this could be bundled into the first point. A setting that folds as much as possible would take care of the dangling lines and whitespace. |
https://jsfiddle.net/rp8m92j5/ This could work, just start cannot be the same. |
Comments, Doc blocks and regions now get folded to a single line in 1.5 |
Linking microsoft/vscode#70794 which may be relevant to item 2 . Would also need changes to LSP. |
Just to confirm if I'm understanding it right, folding from this: to this: is what's currently not possible, right? And it will only be possible with microsoft/vscode#70794, right? |
So, I noticed that gitlens shows the documentation from git blame when you are in any line I noticed that this is also shown in a folded docblock Does that mean that it is possible to show the docblock's first line in a folded docblock? |
There isn't any feedback from folding action, so you can show first line after |
I would really, really like to use structure folding rather than basic indentation folding provided by VS Code. |
Since LSP 3.17 it's possible for the server to provide the text that is shown instead of the collapsed fold: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#version_3_17_0
Are they overlapping, or rather nested? E.g. the following:
doesn't look like overlapping ranges to me. |
Sounds good to me. |
Not yet supported in vscode, PR is constantly being postponed microsoft/vscode#170447
They work like nested, because there is no real use-case for overlapping, but in code they are single-level, and you can make them overlap https://jsfiddle.net/n1jd8q9h/ |
And vim has other means to achieve this, so not a priority for me either. It was more like a note for a potential future feature. |
Feature description or problem with existing feature
I would like to be able to configure the following:
Describe the solution you'd like
Fold the last line of the region
Currently Intelephense omits the last line of the region from the folding range, producing ugly dangling lines at the end of the fold:
While it may make sense for editors like VSCode that lacks
foldtext
callbacks,vim
/nvim
should be able to use more compact folding enhanced byfoldtext
:Even though LSP lacks the facilities to provide the text to show instead of the collapsed region it's not a problem, as it can be done on the client side.
Fold the docblock together with the element it documents
Currently the most compact folded representation for a method with docblock is this:
If docblocks were folded with their corresponding code elements it could be futher compacted to:
(assuming the dangling line problem is solved as well).
Disable / enable block folding
Block folding (bodies of
if
,for
, etc) is annoying when you have a default folding level set to expand classes but collapse method/properties/consts. Ideally I'd like to be able to configure what should be folded (methods, properties with docblocks, standalone functions, use blocks), and what should be not (blocks). This is how it looks currently with method fold opened:And here's what I would like it to be (note that if/foreach blocks are not folded at all):
Include (configurable amount of) trailing white-space only lines into the fold
When you open a class fold, it currently looks like this:
I would like to be able to configure it to look like this:
This would require empty lines following the method closing brace to be included into the fold.
Additional context
The text was updated successfully, but these errors were encountered: