Add log language highlighting

This commit is contained in:
Luck
2023-12-22 21:58:35 +00:00
parent 5ceca3068e
commit 776a1c5def
4 changed files with 154 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ import themes, { Theme } from '../style/themes';
import type { editor } from 'monaco-editor';
import { ResetFunction } from './Editor';
import { logLanguage } from '../util/log-language';
export interface EditorTextAreaProps {
forcedContent: string;
@@ -60,6 +61,9 @@ export default function EditorTextArea({
monaco.editor.defineTheme(theme.id, theme.editor);
}
monaco.languages.register({ id: 'log' });
monaco.languages.setMonarchTokensProvider('log', logLanguage);
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
noSemanticValidation: true,
noSyntaxValidation: true,