diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-10-31 19:53:54 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-10-31 19:53:54 +0100 |
commit | 7ee5f7530e6d7120750811376834bdcacd9ca0d4 (patch) | |
tree | c1e0f0174203be5ef064b666f858b025fb25f0bf /language-web/src/main/js | |
parent | Merge pull request #8 from kris7t/cm6 (diff) | |
download | refinery-7ee5f7530e6d7120750811376834bdcacd9ca0d4.tar.gz refinery-7ee5f7530e6d7120750811376834bdcacd9ca0d4.tar.zst refinery-7ee5f7530e6d7120750811376834bdcacd9ca0d4.zip |
chore: fix Sonar warnings
Diffstat (limited to 'language-web/src/main/js')
-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) { |