mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Merge pull request #7553 from OhMyMndy/codemirror-languages
feat: add HCL highlighting
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import { acceptCompletion } from '@codemirror/autocomplete';
|
||||
import { indentWithTab } from '@codemirror/commands';
|
||||
|
||||
import { indentUnit } from '@codemirror/language';
|
||||
import { indentUnit, LanguageDescription } from '@codemirror/language';
|
||||
import { languages } from '@codemirror/language-data';
|
||||
|
||||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
@@ -47,6 +47,15 @@
|
||||
let editorTheme = new Compartment();
|
||||
let editorLanguage = new Compartment();
|
||||
|
||||
languages.push(
|
||||
LanguageDescription.of({
|
||||
name: 'HCL',
|
||||
extensions: ['hcl', 'tf'],
|
||||
load() {
|
||||
return import('codemirror-lang-hcl').then((m) => m.hcl());
|
||||
}
|
||||
})
|
||||
);
|
||||
const getLang = async () => {
|
||||
const language = languages.find((l) => l.alias.includes(lang));
|
||||
return await language?.load();
|
||||
|
||||
Reference in New Issue
Block a user