From a9e614ce4d826620d7e4b721e5b2accd135f8feb Mon Sep 17 00:00:00 2001 From: Malpha Date: Sun, 18 Feb 2024 23:19:44 +0000 Subject: [PATCH] Add docker-compose language (#9661) * languages: add docker-compose language it uses docker-compose-langserver as lsp And yaml for syntax highlighting, indents and injections * languages: add luajit as a shebang of lua This helps to provide syntax highlighting and other lua goodies when writing luajit * book(update): run cargo xtask docgen * since #8006 full filenames uses glob --- book/src/generated/lang-support.md | 1 + languages.toml | 13 ++++++++++++- runtime/queries/docker-compose/highlights.scm | 1 + runtime/queries/docker-compose/indents.scm | 1 + runtime/queries/docker-compose/injections.scm | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/docker-compose/highlights.scm create mode 100644 runtime/queries/docker-compose/indents.scm create mode 100644 runtime/queries/docker-compose/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index bfe6d6b1e7917..a37e165f29ef3 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -30,6 +30,7 @@ | devicetree | ✓ | | | | | dhall | ✓ | ✓ | | `dhall-lsp-server` | | diff | ✓ | | | | +| docker-compose | ✓ | | ✓ | `docker-compose-langserver` | | dockerfile | ✓ | | | `docker-langserver` | | dot | ✓ | | | `dot-language-server` | | dtd | ✓ | | | | diff --git a/languages.toml b/languages.toml index 78078ca5886a9..e52dcabbcf0a4 100644 --- a/languages.toml +++ b/languages.toml @@ -23,6 +23,7 @@ cuelsp = { command = "cuelsp" } dart = { command = "dart", args = ["language-server", "--client-id=helix"] } dhall-lsp-server = { command = "dhall-lsp-server" } docker-langserver = { command = "docker-langserver", args = ["--stdio"] } +docker-compose-langserver = { command = "docker-compose-langserver", args = ["--stdio"]} dot-language-server = { command = "dot-language-server", args = ["--stdio"] } elixir-ls = { command = "elixir-ls", config = { elixirLS.dialyzerEnabled = false } } elm-language-server = { command = "elm-language-server" } @@ -1092,7 +1093,7 @@ name = "lua" injection-regex = "lua" scope = "source.lua" file-types = ["lua"] -shebangs = ["lua"] +shebangs = ["lua", "luajit"] roots = [".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git"] comment-token = "--" indent = { tab-width = 2, unit = " " } @@ -1460,6 +1461,16 @@ language-servers = [ "docker-langserver" ] name = "dockerfile" source = { git = "https://github.com/camdencheek/tree-sitter-dockerfile", rev = "8ee3a0f7587b2bd8c45c8cb7d28bd414604aec62" } +[[language]] +name = "docker-compose" +scope = "source.yaml.docker-compose" +roots = ["docker-compose.yaml", "docker-compose.yml"] +language-servers = [ "docker-compose-langserver" ] +file-types = [{ glob = "docker-compose.yaml" }, { glob = "docker-compose.yml" }] +comment-token = "#" +indent = { tab-width = 2, unit = " " } +grammar = "yaml" + [[language]] name = "git-commit" scope = "git.commitmsg" diff --git a/runtime/queries/docker-compose/highlights.scm b/runtime/queries/docker-compose/highlights.scm new file mode 100644 index 0000000000000..4ba254e826d2d --- /dev/null +++ b/runtime/queries/docker-compose/highlights.scm @@ -0,0 +1 @@ +; inherits: yaml diff --git a/runtime/queries/docker-compose/indents.scm b/runtime/queries/docker-compose/indents.scm new file mode 100644 index 0000000000000..4ba254e826d2d --- /dev/null +++ b/runtime/queries/docker-compose/indents.scm @@ -0,0 +1 @@ +; inherits: yaml diff --git a/runtime/queries/docker-compose/injections.scm b/runtime/queries/docker-compose/injections.scm new file mode 100644 index 0000000000000..4ba254e826d2d --- /dev/null +++ b/runtime/queries/docker-compose/injections.scm @@ -0,0 +1 @@ +; inherits: yaml