-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Support Collapsed Text #170447
base: main
Are you sure you want to change the base?
Support Collapsed Text #170447
Conversation
…t at the same line but different columns
…result of prevColumnNumber
…n == undefined and other has startColumn == lineMaxColumn
@microsoft-github-policy-service agree |
@aeschli any updates on this? |
Is there any updates? This PR is a must have. Thanks @mtbaqer |
I had a look at the PR now. I am very impressed by the work and I can see that it took a lot of effort to implement this feature! However, because this part of the editor is so complicated, we have to be very careful with how such features are implemented. The implementation of the I think the |
@hediet Thanks for taking the time to look over the PR. I 100% agree that fully implementing the Given your knowledge of the codebase, if you think a full implementation of inline folding is absolutely required, then I understand. However, as much as I would love to implement #50840, I'm afraid I would not be able to anytime soon (I'm graduating soon and still in the middle of a job search). Anyone is more than welcome to build on top my current On the other hand, if there's anything else we can do to this current PR to provide a solution for #70794 that can be merged with much less work required, I would be more than happy to help with what I can. |
Description
Adds VSCode implementation of LSP's collapsed text.
Allows for custom collapsed text instead of the default
...
, and the ability to start folding anywhere in the start line not only at the very end. See the demo below.Demo
Issues
Should make following issues trivial to solve:
Does a lot of heavy lifting for (but still requires some work):
Changes
Adds two fields to almost all inner folding interfaces/classes (
FoldingRange
,FoldingRegion
, etc.):collapsedText
: text to displaystartColumn
: where the folding should start at the start line. More details here.Changes
FoldingDecorations
to dynamically construct collapsed decorations to include collapsed text (currently little messy, will make a future refactor PR to reduce the size of this one).Introduces new
InlineFoldingRange
class to support the customstartColumn
. Currently only supports always folding to the end of the line.Adds new
hideContent
field toModelDecorationOptions
to supportInlineFoldingRange
.Modifies
ModelLineProjection
,ModelLineProjectionData
and related classes to supportinlineFoldingRange
.Adds new test cases and modifies current ones for most classes touched.
Note: The current implementation assumes
InlineFoldingRange
decorations are located in the sameInjectedText
decoration tree. This can be changed in future updates.VSCode Language Server
A new PR against vscode-languageserver-node is needed to support providing ranges through the language server and to update the capability.