Support dockerfiles (#1303)
* allow language.config (in languages.toml) to be passed in as a toml object * Change config field for languages from json string to toml object * remove indents on languages.toml config * fix: remove patch version from serde_json import in helix-core * Use same tree-sitter-zig as upstream/master * fix(completion_popup): Fixes #1256 * Update helix-term/src/ui/completion.rs * feat(languages): Add support for `Dockerfile`s * docs(cargo-xtask-docgen): * improvement(langs-dockerfile): Add `injection-regex` to `languages.toml` for `Dockerfile` * improvement(langs-dockerfile): Add injections.scm * Update .gitmodules Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
This commit is contained in:
parent
75a8b789d2
commit
dba22c60ed
6 changed files with 74 additions and 0 deletions
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -162,6 +162,10 @@
|
||||||
path = helix-syntax/languages/tree-sitter-dart
|
path = helix-syntax/languages/tree-sitter-dart
|
||||||
url = https://github.com/UserNobody14/tree-sitter-dart.git
|
url = https://github.com/UserNobody14/tree-sitter-dart.git
|
||||||
shallow = true
|
shallow = true
|
||||||
|
[submodule "helix-syntax/languages/tree-sitter-dockerfile"]
|
||||||
|
path = helix-syntax/languages/tree-sitter-dockerfile
|
||||||
|
url = https://github.com/camdencheek/tree-sitter-dockerfile.git
|
||||||
|
shallow = true
|
||||||
[submodule "helix-syntax/languages/tree-sitter-fish"]
|
[submodule "helix-syntax/languages/tree-sitter-fish"]
|
||||||
path = helix-syntax/languages/tree-sitter-fish
|
path = helix-syntax/languages/tree-sitter-fish
|
||||||
url = https://github.com/ram02z/tree-sitter-fish
|
url = https://github.com/ram02z/tree-sitter-fish
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
| cpp | ✓ | | | `clangd` |
|
| cpp | ✓ | | | `clangd` |
|
||||||
| css | ✓ | | | |
|
| css | ✓ | | | |
|
||||||
| dart | ✓ | | ✓ | `dart` |
|
| dart | ✓ | | ✓ | `dart` |
|
||||||
|
| dockerfile | ✓ | | | `docker-langserver` |
|
||||||
| elixir | ✓ | | | `elixir-ls` |
|
| elixir | ✓ | | | `elixir-ls` |
|
||||||
| fish | ✓ | ✓ | ✓ | |
|
| fish | ✓ | ✓ | ✓ | |
|
||||||
| glsl | ✓ | | ✓ | |
|
| glsl | ✓ | | ✓ | |
|
||||||
|
|
1
helix-syntax/languages/tree-sitter-dockerfile
Submodule
1
helix-syntax/languages/tree-sitter-dockerfile
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 7af32bc04a66ab196f5b9f92ac471f29372ae2ce
|
|
@ -467,3 +467,14 @@ file-types = ["scala", "sbt"]
|
||||||
comment-token = "//"
|
comment-token = "//"
|
||||||
indent = { tab-width = 2, unit = " " }
|
indent = { tab-width = 2, unit = " " }
|
||||||
language-server = { command = "metals" }
|
language-server = { command = "metals" }
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "dockerfile"
|
||||||
|
scope = "source.dockerfile"
|
||||||
|
injection-regex = "docker|dockerfile"
|
||||||
|
roots = ["Dockerfile"]
|
||||||
|
file-types = ["Dockerfile"]
|
||||||
|
comment-token = "#"
|
||||||
|
indent = { tab-width = 2, unit = " " }
|
||||||
|
language-server = { command = "docker-langserver", args = ["--stdio"] }
|
||||||
|
|
||||||
|
|
51
runtime/queries/dockerfile/highlights.scm
Normal file
51
runtime/queries/dockerfile/highlights.scm
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
[
|
||||||
|
"FROM"
|
||||||
|
"AS"
|
||||||
|
"RUN"
|
||||||
|
"CMD"
|
||||||
|
"LABEL"
|
||||||
|
"EXPOSE"
|
||||||
|
"ENV"
|
||||||
|
"ADD"
|
||||||
|
"COPY"
|
||||||
|
"ENTRYPOINT"
|
||||||
|
"VOLUME"
|
||||||
|
"USER"
|
||||||
|
"WORKDIR"
|
||||||
|
"ARG"
|
||||||
|
"ONBUILD"
|
||||||
|
"STOPSIGNAL"
|
||||||
|
"HEALTHCHECK"
|
||||||
|
"SHELL"
|
||||||
|
"MAINTAINER"
|
||||||
|
"CROSS_BUILD"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
":"
|
||||||
|
"@"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
|
||||||
|
(image_spec
|
||||||
|
(image_tag
|
||||||
|
":" @punctuation.special)
|
||||||
|
(image_digest
|
||||||
|
"@" @punctuation.special))
|
||||||
|
|
||||||
|
(double_quoted_string) @string
|
||||||
|
|
||||||
|
(expansion
|
||||||
|
[
|
||||||
|
"$"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.special
|
||||||
|
) @none
|
||||||
|
|
||||||
|
((variable) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||||
|
|
||||||
|
|
6
runtime/queries/dockerfile/injections.scm
Normal file
6
runtime/queries/dockerfile/injections.scm
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
|
([(shell_command) (shell_fragment)] @injection.content
|
||||||
|
(#set! injection.language "bash"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue