feat: syntax highlighting for cURL and bulk editors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user