diff options
author | 2021-10-31 19:55:06 +0100 | |
---|---|---|
committer | 2021-10-31 19:55:06 +0100 | |
commit | 871cb53b305481baf4f6ec4199019a10587de6ae (patch) | |
tree | c1e0f0174203be5ef064b666f858b025fb25f0bf /language-web/src/main | |
parent | Merge pull request #8 from kris7t/cm6 (diff) | |
parent | chore: fix Sonar warnings (diff) | |
download | refinery-871cb53b305481baf4f6ec4199019a10587de6ae.tar.gz refinery-871cb53b305481baf4f6ec4199019a10587de6ae.tar.zst refinery-871cb53b305481baf4f6ec4199019a10587de6ae.zip |
Merge pull request #9 from kris7t/cm6-sonar-fixes
Fix Sonar warnings introduced by CodeMirror 6 migration
Diffstat (limited to 'language-web/src/main')
-rw-r--r-- | language-web/src/main/js/editor/EditorArea.tsx | 5 | ||||
-rw-r--r-- | language-web/src/main/js/language/indentation.ts | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/language-web/src/main/js/editor/EditorArea.tsx b/language-web/src/main/js/editor/EditorArea.tsx index 678a632d..dba20f6e 100644 --- a/language-web/src/main/js/editor/EditorArea.tsx +++ b/language-web/src/main/js/editor/EditorArea.tsx | |||
@@ -95,8 +95,9 @@ export const EditorArea = observer(() => { | |||
95 | 95 | ||
96 | useEffect(() => { | 96 | useEffect(() => { |
97 | if (editorParentRef.current === null) { | 97 | if (editorParentRef.current === null) { |
98 | // Nothing to clean up. | 98 | return () => { |
99 | return () => {}; | 99 | // Nothing to clean up. |
100 | }; | ||
100 | } | 101 | } |
101 | 102 | ||
102 | const editorView = new EditorView({ | 103 | const editorView = new EditorView({ |
diff --git a/language-web/src/main/js/language/indentation.ts b/language-web/src/main/js/language/indentation.ts index 78f0a750..6d36ed3b 100644 --- a/language-web/src/main/js/language/indentation.ts +++ b/language-web/src/main/js/language/indentation.ts | |||
@@ -77,7 +77,7 @@ export function indentDeclaration(context: TreeIndentContext): number { | |||
77 | 77 | ||
78 | export function indentPredicateOrRule(context: TreeIndentContext): number { | 78 | export function indentPredicateOrRule(context: TreeIndentContext): number { |
79 | const clauseIndent = indentDeclarationStrategy(context, 1); | 79 | const clauseIndent = indentDeclarationStrategy(context, 1); |
80 | if (/^\s+(;|\.)/.exec(context.textAfter) !== null) { | 80 | if (/^\s+[;.]/.exec(context.textAfter) !== null) { |
81 | return clauseIndent - 2; | 81 | return clauseIndent - 2; |
82 | } | 82 | } |
83 | if (/^\s+(~>)/.exec(context.textAfter) !== null) { | 83 | if (/^\s+(~>)/.exec(context.textAfter) !== null) { |