Skip to content

Multiline comments collapse to one line #1695

Answered by msujew
wa8f7192 asked this question in Q&A
Discussion options

You must be logged in to vote

See also the includeLastFoldingLine method that explicitly controls this behavior:

protected includeLastFoldingLine(node: CstNode, kind?: string): boolean {
if (kind === FoldingRangeKind.Comment) {
return false;
}
const nodeText = node.text;
const endChar = nodeText.charAt(nodeText.length - 1);
if (endChar === '}' || endChar === ')' || endChar === ']') {
return false;
}
return true;

@wa8f7192 You can override the class to change the behavior according to your liking.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@msujew
Comment options

Answer selected by wa8f7192
@wa8f7192
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants