You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like #1779, I would like to see improvements to the folding range support. However, I decided to file this one a a separate issue, because it would need more than defining more folding range kinds.
I would also very much like to see the "hoist small function to single line"-folding range. As an example, JetBrains IDE supports folding
publicvoidsetFoo(Stringfoo) {
this.foo = foo;
}
into:
publicvoidsetFoo(Stringfoo) { this.foo = foo; }
In the JetBrains IDE, this is done by emitting two folding ranges. The first for the start brace and one for the end brace and their related whitespace (notably the newline). In this example, marked by [...] ranges with the original content inside the [...].
The two folding ranges are then defined to related, so that the editor knows that that should expand/fold at the same time. The "two range" approach could have been replaced by a single range. However, the folding range text is not rendered as code. That is, syntax highlighting is lost. I think that would equally be true for most LSP clients since the collapsedText attribute is defined as text (and not stylish-able code - also, even then, it would be a layer violation for the folding range code to figure out how to highlight one line of code, no matter if it is in the server or the client).
This "two range"-mode example shown above would require the client to announce FoldingRangeClientCapabilities.lineFoldingOnly=false to be possible (making the dependency explicit).
The text was updated successfully, but these errors were encountered:
Hi
Like #1779, I would like to see improvements to the folding range support. However, I decided to file this one a a separate issue, because it would need more than defining more folding range kinds.
I would also very much like to see the "hoist small function to single line"-folding range. As an example, JetBrains IDE supports folding
into:
In the JetBrains IDE, this is done by emitting two folding ranges. The first for the start brace and one for the end brace and their related whitespace (notably the newline). In this example, marked by
[...]
ranges with the original content inside the[...]
.The two folding ranges are then defined to related, so that the editor knows that that should expand/fold at the same time. The "two range" approach could have been replaced by a single range. However, the folding range text is not rendered as code. That is, syntax highlighting is lost. I think that would equally be true for most LSP clients since the
collapsedText
attribute is defined as text (and not stylish-able code - also, even then, it would be a layer violation for the folding range code to figure out how to highlight one line of code, no matter if it is in the server or the client).This "two range"-mode example shown above would require the client to announce
FoldingRangeClientCapabilities.lineFoldingOnly=false
to be possible (making the dependency explicit).The text was updated successfully, but these errors were encountered: