Skip to content
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

Add code folding on single line comment #565

Conversation

marieflorescontact
Copy link
Collaborator

2nd step of #560 issue: code folding on single line comment.

const startIndex = singleLineCommentStartIndexes.pop()
const endIndex = lineIndex - 1
if (endIndex - startIndex > 0) {
foldingRanges.push(new vscode.FoldingRange(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also create a folding range when singleLineCommentStartIndexes is not empty and we are on the last line. For instance:

This is a paragraph.

// This is a comment.
// The last line of the document is also a comment!

@marieflorescontact marieflorescontact force-pushed the Add-code-folding-on-single-line-comment-block branch from 31f94b0 to 226e5f4 Compare April 11, 2022 08:08
@marieflorescontact marieflorescontact force-pushed the Add-code-folding-on-single-line-comment-block branch from 61d7554 to 6dc1e6e Compare April 11, 2022 09:10
@ggrossetie ggrossetie self-requested a review April 11, 2022 09:27
Copy link
Member

@ggrossetie ggrossetie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thanks 👍🏻

@ggrossetie ggrossetie merged commit 5853aa9 into asciidoctor:master Apr 11, 2022
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.

None yet

2 participants