aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/language/folding.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/language/folding.ts')
-rw-r--r--subprojects/frontend/src/language/folding.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/subprojects/frontend/src/language/folding.ts b/subprojects/frontend/src/language/folding.ts
index 5d51f796..2560c183 100644
--- a/subprojects/frontend/src/language/folding.ts
+++ b/subprojects/frontend/src/language/folding.ts
@@ -52,7 +52,7 @@ export function foldDeclaration(node: SyntaxNode, state: EditorState): FoldRange
52 if (open === null || close === null) { 52 if (open === null || close === null) {
53 return null; 53 return null;
54 } 54 }
55 const { cursor } = open; 55 const cursor = open.cursor();
56 const lineEnd = state.doc.lineAt(open.from).to; 56 const lineEnd = state.doc.lineAt(open.from).to;
57 let foldFrom = open.to; 57 let foldFrom = open.to;
58 while (cursor.next() && cursor.from < lineEnd) { 58 while (cursor.next() && cursor.from < lineEnd) {
@@ -84,7 +84,7 @@ function foldWithSibling(node: SyntaxNode): FoldRange | null {
84 if (firstChild === null) { 84 if (firstChild === null) {
85 return null; 85 return null;
86 } 86 }
87 const { cursor } = firstChild; 87 const cursor = firstChild.cursor();
88 let nSiblings = 0; 88 let nSiblings = 0;
89 while (cursor.nextSibling()) { 89 while (cursor.nextSibling()) {
90 if (cursor.type === node.type) { 90 if (cursor.type === node.type) {