File tree Expand file tree Collapse file tree
frontend/src/component/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import { StatusFallback } from "../common/StatusFallback";
88import { Button } from "../common/Button" ;
99import { EditorView } from "codemirror" ;
1010import { IconDeviceFloppy } from "@tabler/icons-solidjs" ;
11- import { Text } from "@codemirror/state" ;
1211
1312export function ConfigEditor ( props : { guildID : string ; plugin : string ; } ) {
1413 const guild = ( ) => useGuild ( props . guildID ) ;
Original file line number Diff line number Diff line change @@ -5,18 +5,21 @@ import { gruvboxDark } from "@fsegurai/codemirror-theme-gruvbox-dark";
55import { basicSetup } from "codemirror" ;
66import { parser } from "lezer-toml" ;
77
8- const parserWithMetadata = parser . configure ( {
9- props : [
10- indentNodeProp . add ( { Array : continuedIndent ( { except : / ^ \s * ] / } ) } ) ,
11- ]
8+ const toml = LRLanguage . define ( {
9+ parser : parser . configure ( {
10+ props : [
11+ indentNodeProp . add ( { Array : continuedIndent ( { except : / ^ \s * ] / } ) } ) ,
12+ ]
13+ } ) ,
14+ languageData : {
15+ commentTokens : { line : "#" }
16+ }
1217} ) ;
1318
1419export function baseExtensions ( saveAction : Command ) {
1520 return [
1621 basicSetup ,
17- LRLanguage . define ( {
18- parser : parserWithMetadata ,
19- } ) ,
22+ toml ,
2023 keymap . of ( [ {
2124 key : "Tab" ,
2225 run : insertTab ,
You can’t perform that action at this time.
0 commit comments