-
Notifications
You must be signed in to change notification settings - Fork 855
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
Fix code-folding for LSP clients that support line-folding only #7750
Fix code-folding for LSP clients that support line-folding only #7750
Conversation
On a (relatively) quick review, this seems OK to me. But, I would say the |
Thanks @lahodaj for taking a quick look at this draft PR. I intended to add the unit tests before making it ready-for-review. :) |
1. Added `TextDocumentServiceImpl.convertToLineOnlyFolds` which: - accepts code-folds specified as fine-grained Position-based (line, column) ranges, and, - changes them to coarse-grained line-only ranges. - The line-only ranges computed uphold the code-folding invariant that: *a fold **does not end** at the same point **where** another fold **starts**. * 2. This is used in `TextDocumentServiceImpl.foldingRange()` when the client capabilities have `FoldingRangeClientCapabilities.lineFoldingOnly = true`. Signed-off-by: Siddharth Srinivasan <[email protected]>
e914d3a
to
d371a8c
Compare
I added the unit test for this enhancement. @lahodaj - Please review whenever you get a chance. Thank you. |
@lahodaj Request you to please facilitate in reviewing this PR. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me. Thanks!
Thank you very much. |
Unless there are objections, I'll merge tonight. |
…ation Added the backport of the Netbeans PR apache/netbeans#7750 patch which allows supporting LSP clients which have line-only folding support. - This is the case of VS Code as referenced in microsoft/vscode#50840. Closes oracle#249 Signed-off-by: Siddharth Srinivasan <[email protected]>
…ation Added the backport of the Netbeans PR apache/netbeans#7750 patch which allows supporting LSP clients which have line-only folding support. - This is the case of VS Code as referenced in microsoft/vscode#50840. Closes oracle#249 Signed-off-by: Siddharth Srinivasan <[email protected]>
The LSP I was trying to look to this PR's github workflow actions but could not find it. I am not sure why the github actions didn't run on the PR. I am very sorry for this unit tests breakage. I will need to add the following fix to TextDocumentServiceImpl
|
How about this: |
Thank you very much @lahodaj. |
I am also not completely sure what happened here. But it looks like the last change to this branch was about a month ago, and github didn't add the green check mark there. This could mean that the CI-run was waiting to be approved for this PR and nobody pressed the button? But this is just a guess - could be something else. here our PR review / merge check list as reminder: in particular:
|
Added
TextDocumentServiceImpl.convertToLineOnlyFolds
which:This is used in
TextDocumentServiceImpl.foldingRange()
when the client capabilities haveFoldingRangeClientCapabilities.lineFoldingOnly = true
.Symptoms of this issue maybe seen in oracle/javavscode#249.