Write the logic template for updating themes

This commit is contained in:
2023-12-15 15:49:33 +01:00
parent eb103dbebd
commit 69cd462c68
3 changed files with 30 additions and 2 deletions

View File

@ -18,6 +18,7 @@ import {
syntaxHighlighting,
indentOnInput,
bracketMatching,
HighlightStyle,
} from "@codemirror/language";
import { defaultKeymap, historyKeymap, history } from "@codemirror/commands";
import { searchKeymap, highlightSelectionMatches } from "@codemirror/search";
@ -36,6 +37,15 @@ import { inlineHoveringTips } from "./documentation/inlineHelp";
import { toposCompletions, soundCompletions } from "./documentation/inlineHelp";
import { javascriptLanguage } from "@codemirror/lang-javascript";
export const updateCodeMirrorTheme = (theme: {[key: string]: string}): Extension => {
let toposTheme = EditorView.theme({
});
let toposHighlightStyle = HighlightStyle.define([]);
return [ toposTheme, syntaxHighlighting(toposHighlightStyle),
]
}
export const jsCompletions = javascriptLanguage.data.of({
autocomplete: toposCompletions,
});