chore(code): reintegrate hcl syntax

This commit is contained in:
Elian Doran
2025-05-11 10:54:15 +03:00
parent efc08a61ef
commit 9f3e990c95
4 changed files with 33 additions and 31 deletions

View File

@@ -68,8 +68,14 @@ export default class CodeMirror extends EditorView {
const correspondingSyntax = byMimeType[mime];
if (correspondingSyntax) {
const extension = StreamLanguage.define(await correspondingSyntax());
newExtension.push(extension);
const resolvedSyntax = await correspondingSyntax();
if ("token" in resolvedSyntax) {
const extension = StreamLanguage.define(resolvedSyntax);
newExtension.push(extension);
} else {
newExtension.push(resolvedSyntax());
}
}
this.dispatch({