Skip to content

Improve folding of line comments #804

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

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 25, 2023

Previously, the folding range of a block of line comments was ended after the newline of the last line comment, which would usually be the line of the function’s start. That caused VS Code to not show a folding range for the function body itself since it started on the same line that the line comment folding range ended.

Rewrite the trivia folding logic so that the folding range of those line comments ends on the line of the last line comment.

Fixes #803
rdar://114428202

Previously, the folding range of a block of line comments was ended after the newline of the last line comment, which would usually be the line of the function’s start. That caused VS Code to not show a folding range for the function body itself since it started on the same line that the line comment folding range ended.

Rewrite the trivia folding logic so that the folding range of those line comments ends on the line of the last line comment.

Fixes swiftlang#803
rdar://114428202
@ahoppen ahoppen requested a review from bnbarham August 25, 2023 16:53
@ahoppen ahoppen marked this pull request as ready for review August 25, 2023 16:53
@ahoppen ahoppen requested a review from benlangmuir as a code owner August 25, 2023 16:53
@ahoppen
Copy link
Member Author

ahoppen commented Aug 25, 2023

@swift-ci Please test

@ahoppen ahoppen merged commit 39c2577 into swiftlang:main Aug 25, 2023
@ahoppen ahoppen deleted the ahoppen/line-comment-folding branch August 25, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issue from vscode-swift#587
2 participants