Add project-aware playground completion
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import { HighlightStyle, LRLanguage, LanguageSupport, foldNodeProp, indentNodeProp, syntaxHighlighting } from 'npm:@codemirror/language@^6.12.4';
|
||||
import { HighlightStyle, LRLanguage, LanguageSupport, delimitedIndent, foldNodeProp, indentNodeProp, syntaxHighlighting } from 'npm:@codemirror/language@^6.12.4';
|
||||
import { styleTags, tags as t } from 'npm:@lezer/highlight@^1.2.3';
|
||||
import { parser } from './decodal-parser-jsr.js';
|
||||
|
||||
@@ -29,10 +29,10 @@ const parserWithMetadata = parser.configure({
|
||||
'Semicolon Comma Dot Colon': t.punctuation,
|
||||
}),
|
||||
indentNodeProp.add({
|
||||
Object: context => context.column(context.node.from) + context.unit,
|
||||
Array: context => context.column(context.node.from) + context.unit,
|
||||
ArrayConstraint: context => context.column(context.node.from) + context.unit,
|
||||
MatchExpression: context => context.column(context.node.from) + context.unit,
|
||||
Object: delimitedIndent({ closing: '}', align: false }),
|
||||
Array: delimitedIndent({ closing: ']', align: false }),
|
||||
ArrayConstraint: delimitedIndent({ closing: ']', align: false }),
|
||||
MatchExpression: delimitedIndent({ closing: '}', align: false }),
|
||||
LetExpression: context => context.column(context.node.from) + context.unit,
|
||||
}),
|
||||
foldNodeProp.add({
|
||||
|
||||
Reference in New Issue
Block a user