aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis2022-06-28 03:18:38 +0000
committerGitHub2022-06-28 03:18:38 +0000
commit64cf4c859b67c98042e2d66f26be0ce4a7afc6e0 (patch)
tree8388e059d6886417fd015f23d8365733971a5c4f
parent6f932375bf47ebc1d4da1e5445fdbc82ea53453f (diff)
support Bazel languages (#2903)
-rw-r--r--book/src/generated/lang-support.md1
-rw-r--r--languages.toml12
-rw-r--r--runtime/queries/starlark/highlights.scm1
-rw-r--r--runtime/queries/starlark/injections.scm2
-rw-r--r--runtime/queries/starlark/textobjects.scm1
5 files changed, 16 insertions, 1 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 7d0ac202..5ea18ae8 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -85,6 +85,7 @@
| solidity | ✓ | | | `solc` |
| sql | ✓ | | | |
| sshclientconfig | ✓ | | | |
+| starlark | ✓ | ✓ | | |
| svelte | ✓ | | ✓ | `svelteserver` |
| swift | ✓ | | | `sourcekit-lsp` |
| tablegen | ✓ | ✓ | ✓ | |
diff --git a/languages.toml b/languages.toml
index aba5fd44..0e6cbb9c 100644
--- a/languages.toml
+++ b/languages.toml
@@ -461,7 +461,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-ruby", rev = "dfff6
name = "bash"
scope = "source.bash"
injection-regex = "bash"
-file-types = ["sh", "bash", "zsh", ".bash_login", ".bash_logout", ".bash_profile", ".bashrc", ".profile", ".zshenv", ".zlogin", ".zlogout", ".zprofile", ".zshrc", "APKBUILD", "PKGBUILD", "eclass", "ebuild"]
+file-types = ["sh", "bash", "zsh", ".bash_login", ".bash_logout", ".bash_profile", ".bashrc", ".profile", ".zshenv", ".zlogin", ".zlogout", ".zprofile", ".zshrc", "APKBUILD", "PKGBUILD", "eclass", "ebuild", "bazelrc"]
shebangs = ["sh", "bash", "dash"]
roots = []
comment-token = "#"
@@ -1478,3 +1478,13 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "clojure"
source = { git = "https://github.com/sogaiu/tree-sitter-clojure", rev = "e57c569ae332ca365da623712ae1f50f84daeae2" }
+
+[[language]]
+name = "starlark"
+scope = "source.starlark"
+injection-regex = "(starlark|bzl|bazel)"
+file-types = ["bzl", "bazel", "BUILD"]
+roots = []
+comment-token = "#"
+indent = { tab-width = 4, unit = " " }
+grammar = "python"
diff --git a/runtime/queries/starlark/highlights.scm b/runtime/queries/starlark/highlights.scm
new file mode 100644
index 00000000..0b920cbf
--- /dev/null
+++ b/runtime/queries/starlark/highlights.scm
@@ -0,0 +1 @@
+; inherits: python
diff --git a/runtime/queries/starlark/injections.scm b/runtime/queries/starlark/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/starlark/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/starlark/textobjects.scm b/runtime/queries/starlark/textobjects.scm
new file mode 100644
index 00000000..0b920cbf
--- /dev/null
+++ b/runtime/queries/starlark/textobjects.scm
@@ -0,0 +1 @@
+; inherits: python