aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/language
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-10-30 21:25:41 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-10-31 19:26:15 +0100
commitac73c31388afdffe7e56236cd619a7a08eb1fac8 (patch)
treed36537cd22412960e49b5c5ef47f349c545edef9 /language-web/src/main/js/language
parentfeat(web): semantic highlighting (diff)
downloadrefinery-ac73c31388afdffe7e56236cd619a7a08eb1fac8.tar.gz
refinery-ac73c31388afdffe7e56236cd619a7a08eb1fac8.tar.zst
refinery-ac73c31388afdffe7e56236cd619a7a08eb1fac8.zip
feat(web): use 4 space for indentation
Diffstat (limited to 'language-web/src/main/js/language')
-rw-r--r--language-web/src/main/js/language/indentation.ts2
-rw-r--r--language-web/src/main/js/language/problemLanguageSupport.ts5
2 files changed, 5 insertions, 2 deletions
diff --git a/language-web/src/main/js/language/indentation.ts b/language-web/src/main/js/language/indentation.ts
index b2f0134b..973b4a80 100644
--- a/language-web/src/main/js/language/indentation.ts
+++ b/language-web/src/main/js/language/indentation.ts
@@ -78,7 +78,7 @@ export function indentDeclaration(context: TreeIndentContext): number {
78export function indentPredicate(context: TreeIndentContext): number { 78export function indentPredicate(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 - context.unit; 81 return clauseIndent - 2;
82 } 82 }
83 return clauseIndent; 83 return clauseIndent;
84} 84}
diff --git a/language-web/src/main/js/language/problemLanguageSupport.ts b/language-web/src/main/js/language/problemLanguageSupport.ts
index c9e61b31..80d25d71 100644
--- a/language-web/src/main/js/language/problemLanguageSupport.ts
+++ b/language-web/src/main/js/language/problemLanguageSupport.ts
@@ -3,6 +3,7 @@ import {
3 foldInside, 3 foldInside,
4 foldNodeProp, 4 foldNodeProp,
5 indentNodeProp, 5 indentNodeProp,
6 indentUnit,
6 LanguageSupport, 7 LanguageSupport,
7 LRLanguage, 8 LRLanguage,
8} from '@codemirror/language'; 9} from '@codemirror/language';
@@ -79,5 +80,7 @@ const problemLanguage = LRLanguage.define({
79}); 80});
80 81
81export function problemLanguageSupport(): LanguageSupport { 82export function problemLanguageSupport(): LanguageSupport {
82 return new LanguageSupport(problemLanguage); 83 return new LanguageSupport(problemLanguage, [
84 indentUnit.of(' '),
85 ]);
83} 86}