diff options
Diffstat (limited to 'subprojects/frontend/src/language')
-rw-r--r-- | subprojects/frontend/src/language/folding.ts | 4 | ||||
-rw-r--r-- | subprojects/frontend/src/language/indentation.ts | 2 | ||||
-rw-r--r-- | subprojects/frontend/src/language/problemLanguageSupport.ts | 2 |
3 files changed, 4 insertions, 4 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) { |
diff --git a/subprojects/frontend/src/language/indentation.ts b/subprojects/frontend/src/language/indentation.ts index 6d36ed3b..55dcd7f1 100644 --- a/subprojects/frontend/src/language/indentation.ts +++ b/subprojects/frontend/src/language/indentation.ts | |||
@@ -23,7 +23,7 @@ function findAlignmentAfterOpening(context: TreeIndentContext): number | null { | |||
23 | const lineEnd = simulatedBreak == null || simulatedBreak <= openingLine.from | 23 | const lineEnd = simulatedBreak == null || simulatedBreak <= openingLine.from |
24 | ? openingLine.to | 24 | ? openingLine.to |
25 | : Math.min(openingLine.to, simulatedBreak); | 25 | : Math.min(openingLine.to, simulatedBreak); |
26 | const { cursor } = openingToken; | 26 | const cursor = openingToken.cursor(); |
27 | while (cursor.next() && cursor.from < lineEnd) { | 27 | while (cursor.next() && cursor.from < lineEnd) { |
28 | if (!cursor.type.isSkipped) { | 28 | if (!cursor.type.isSkipped) { |
29 | return cursor.from; | 29 | return cursor.from; |
diff --git a/subprojects/frontend/src/language/problemLanguageSupport.ts b/subprojects/frontend/src/language/problemLanguageSupport.ts index b858ba91..b6e2f14e 100644 --- a/subprojects/frontend/src/language/problemLanguageSupport.ts +++ b/subprojects/frontend/src/language/problemLanguageSupport.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | import { styleTags, tags as t } from '@codemirror/highlight'; | ||
2 | import { | 1 | import { |
3 | foldInside, | 2 | foldInside, |
4 | foldNodeProp, | 3 | foldNodeProp, |
@@ -7,6 +6,7 @@ import { | |||
7 | LanguageSupport, | 6 | LanguageSupport, |
8 | LRLanguage, | 7 | LRLanguage, |
9 | } from '@codemirror/language'; | 8 | } from '@codemirror/language'; |
9 | import { styleTags, tags as t } from '@lezer/highlight'; | ||
10 | import { LRParser } from '@lezer/lr'; | 10 | import { LRParser } from '@lezer/lr'; |
11 | 11 | ||
12 | import { parser } from '../../build/generated/sources/lezer/problem'; | 12 | import { parser } from '../../build/generated/sources/lezer/problem'; |