feat: syntax highlighting for cURL and bulk editors

This commit is contained in:
liyasthomas
2021-12-29 08:05:07 +05:30
parent 923c24e3bb
commit a1decaf6ad
34 changed files with 50 additions and 48 deletions

View File

@@ -31,6 +31,8 @@ import { pipe } from "fp-ts/function"
import * as O from "fp-ts/Option"
import { StreamLanguage } from "@codemirror/stream-parser"
import { html } from "@codemirror/legacy-modes/mode/xml"
import { shell } from "@codemirror/legacy-modes/mode/shell"
import { yaml } from "@codemirror/legacy-modes/mode/yaml"
import { isJSONContentType } from "../utils/contenttypes"
import { useStreamSubscriber } from "../utils/composables"
import { Completer } from "./completion"
@@ -136,6 +138,10 @@ const getLanguage = (langMime: string): Language | null => {
return GQLLanguage
} else if (langMime === "htmlmixed") {
return StreamLanguage.define(html)
} else if (langMime === "application/x-sh") {
return StreamLanguage.define(shell)
} else if (langMime === "text/x-yaml") {
return StreamLanguage.define(yaml)
}
// None matched, so return null