From 740b3a7664fbfc9b71c6cf9e0721412983c947c6 Mon Sep 17 00:00:00 2001 From: Viktoras Date: Wed, 14 Feb 2024 23:35:45 +0200 Subject: [PATCH] Add go snippet support (#709) --- common/deps.ts | 1 + common/languages.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/common/deps.ts b/common/deps.ts index b924253e..d16c8cd2 100644 --- a/common/deps.ts +++ b/common/deps.ts @@ -59,6 +59,7 @@ export { toml as tomlLanguage } from "@codemirror/legacy-modes/mode/toml?externa export { xml as xmlLanguage } from "@codemirror/legacy-modes/mode/xml?external=@codemirror/language&target=es2022"; export { json as jsonLanguage } from "@codemirror/legacy-modes/mode/javascript?external=@codemirror/language&target=es2022"; export { htmlLanguage } from "@codemirror/lang-html"; +export { go as goLanguage } from "@codemirror/legacy-modes/mode/go?external=@codemirror/language&target=es2022"; export { Language, StreamLanguage } from "@codemirror/language"; diff --git a/common/languages.ts b/common/languages.ts index 525e27f9..1eb08b20 100644 --- a/common/languages.ts +++ b/common/languages.ts @@ -24,6 +24,7 @@ import { typescriptLanguage, xmlLanguage, yamlLanguage, + goLanguage, } from "./deps.ts"; import { extendedMarkdownLanguage, @@ -83,6 +84,8 @@ export const builtinLanguages: Record = { "objective-c++": StreamLanguage.define(objectiveCppLanguage), "objectivec++": StreamLanguage.define(objectiveCppLanguage), "dart": StreamLanguage.define(dartLanguage), + "go": StreamLanguage.define(goLanguage), + "golang": StreamLanguage.define(goLanguage), "query": LRLanguage.define({ name: "query", parser: highlightingQueryParser,