Add project-aware playground completion

This commit is contained in:
2026-08-13 18:07:24 +09:00
parent 610358110f
commit e862e53f3e
9 changed files with 416 additions and 12 deletions
+5 -5
View File
@@ -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({