on master help sign in
Support dockerfiles (#1303)
dba22c6Midnight Exigent
.gitmodules+4
@@ -162,6 +162,10 @@
162 path = helix-syntax/languages/tree-sitter-dart
162 path = helix-syntax/languages/tree-sitter-dart
163 url = https://github.com/UserNobody14/tree-sitter-dart.git
163 url = https://github.com/UserNobody14/tree-sitter-dart.git
164 shallow = true
164 shallow = true
165+[submodule "helix-syntax/languages/tree-sitter-dockerfile"]
166+ path = helix-syntax/languages/tree-sitter-dockerfile
167+ url = https://github.com/camdencheek/tree-sitter-dockerfile.git
168+ shallow = true
165[submodule "helix-syntax/languages/tree-sitter-fish"]
169[submodule "helix-syntax/languages/tree-sitter-fish"]
166 path = helix-syntax/languages/tree-sitter-fish
170 path = helix-syntax/languages/tree-sitter-fish
167 url = https://github.com/ram02z/tree-sitter-fish
171 url = https://github.com/ram02z/tree-sitter-fish
book/src/generated/lang-support.md+1
@@ -8,6 +8,7 @@
8| cpp | ✓ | | | `clangd` |
8| cpp | ✓ | | | `clangd` |
9| css | ✓ | | | |
9| css | ✓ | | | |
10| dart | ✓ | | ✓ | `dart` |
10| dart | ✓ | | ✓ | `dart` |
11+| dockerfile | ✓ | | | `docker-langserver` |
11| elixir | ✓ | | | `elixir-ls` |
12| elixir | ✓ | | | `elixir-ls` |
12| fish | ✓ | ✓ | ✓ | |
13| fish | ✓ | ✓ | ✓ | |
13| glsl | ✓ | | ✓ | |
14| glsl | ✓ | | ✓ | |
helix-syntax/languages/tree-sitter-dockerfilenew file+1

Submodule changed.

languages.toml+11
@@ -467,3 +467,14 @@ file-types = ["scala", "sbt"]
467comment-token = "//"
467comment-token = "//"
468indent = { tab-width = 2, unit = " " }
468indent = { tab-width = 2, unit = " " }
469language-server = { command = "metals" }
469language-server = { command = "metals" }
470+
471+[[language]]
472+name = "dockerfile"
473+scope = "source.dockerfile"
474+injection-regex = "docker|dockerfile"
475+roots = ["Dockerfile"]
476+file-types = ["Dockerfile"]
477+comment-token = "#"
478+indent = { tab-width = 2, unit = " " }
479+language-server = { command = "docker-langserver", args = ["--stdio"] }
480+
runtime/queries/dockerfile/highlights.scmnew file+51
@@ -0,0 +1,51 @@
1+[
2+ "FROM"
3+ "AS"
4+ "RUN"
5+ "CMD"
6+ "LABEL"
7+ "EXPOSE"
8+ "ENV"
9+ "ADD"
10+ "COPY"
11+ "ENTRYPOINT"
12+ "VOLUME"
13+ "USER"
14+ "WORKDIR"
15+ "ARG"
16+ "ONBUILD"
17+ "STOPSIGNAL"
18+ "HEALTHCHECK"
19+ "SHELL"
20+ "MAINTAINER"
21+ "CROSS_BUILD"
22+] @keyword
23+
24+[
25+ ":"
26+ "@"
27+] @operator
28+
29+(comment) @comment
30+
31+
32+(image_spec
33+ (image_tag
34+ ":" @punctuation.special)
35+ (image_digest
36+ "@" @punctuation.special))
37+
38+(double_quoted_string) @string
39+
40+(expansion
41+ [
42+ "$"
43+ "{"
44+ "}"
45+ ] @punctuation.special
46+) @none
47+
48+((variable) @constant
49+ (#match? @constant "^[A-Z][A-Z_0-9]*$"))
50+
51+
runtime/queries/dockerfile/injections.scmnew file+6
@@ -0,0 +1,6 @@
1+((comment) @injection.content
2+ (#set! injection.language "comment"))
3+
4+([(shell_command) (shell_fragment)] @injection.content
5+ (#set! injection.language "bash"))
6+