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
Draft
mtbaqer
wants to merge
23
commits into
microsoft:main
Choose a base branch
from
mtbaqer:collapsed-text
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Support Collapsed Text #170447
+2,068
−389
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t at the same line but different columns
…result of prevColumnNumber
…n == undefined and other has startColumn == lineMaxColumn
|
@microsoft-github-policy-service agree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.


Description
Adds VSCode client 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
FoldingDecorationsto 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
InlineFoldingRangeclass to support the customstartColumn.Adds new
hideContentfield toModelDecorationOptionsto supportInlineFoldingRange.Modifies
ModelLineProjection,ModelLineProjectionDataand related classes to supportinlineFoldingRange.Adds new test cases and modifies current ones for most classes touched.
Note: The current implementation assumes
InlineFoldingRangedecorations are located in the sameInjectedTextdecoration tree. This can be changed in future updates.PR Draft
Draft because I could some help with
vscode.d.tsproposal and best place for enforcingisProposedApiEnabled