Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dockerfiles #1303

Merged
merged 22 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
eb6c400
allow language.config (in languages.toml) to be passed in as a toml o…
midnightexigent Oct 3, 2021
2f7a20c
Merge branch 'helix-editor:master' into master
midnightexigent Oct 5, 2021
b323987
Change config field for languages from json string to toml object
midnightexigent Oct 5, 2021
1b322c5
remove indents on languages.toml config
midnightexigent Oct 5, 2021
f3e1942
fix: remove patch version from serde_json import in helix-core
midnightexigent Oct 6, 2021
d5f9232
Use same tree-sitter-zig as upstream/master
midnightexigent Oct 6, 2021
3b465ca
Merge branch 'helix-editor:master' into master
midnightexigent Oct 13, 2021
64c6447
Merge branch 'helix-editor:master' into master
midnightexigent Dec 13, 2021
2bc50e1
fix(completion_popup): Fixes #1256
midnightexigent Dec 13, 2021
40c771b
Merge branch 'helix-editor:master' into master
midnightexigent Dec 13, 2021
790de88
Merge branch 'helix-editor:master' into master
midnightexigent Dec 14, 2021
5fdee9c
Update helix-term/src/ui/completion.rs
archseer Dec 14, 2021
a40f591
Merge branch 'helix-editor:master' into master
midnightexigent Dec 14, 2021
cc72d72
Merge branch 'helix-editor:master' into master
midnightexigent Dec 19, 2021
7a590d3
feat(languages): Add support for `Dockerfile`s
midnightexigent Dec 19, 2021
1a4df2a
docs(cargo-xtask-docgen):
midnightexigent Dec 19, 2021
8bb6a3c
improvement(langs-dockerfile): Add `injection-regex` to `languages.to…
midnightexigent Dec 19, 2021
b44d4e5
Merge remote-tracking branch 'upstream/master'
midnightexigent Dec 19, 2021
920747e
Merge branch 'helix-editor:master' into master
midnightexigent Dec 20, 2021
ec5ebc7
improvement(langs-dockerfile): Add injections.scm
midnightexigent Dec 21, 2021
7c4e7f7
Merge branch 'master' into master
midnightexigent Dec 21, 2021
544161b
Update .gitmodules
midnightexigent Dec 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@
path = helix-syntax/languages/tree-sitter-dart
url = https://github.com/UserNobody14/tree-sitter-dart.git
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"]
path = helix-syntax/languages/tree-sitter-fish
url = https://github.com/ram02z/tree-sitter-fish
Expand Down
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| cpp | ✓ | | | `clangd` |
| css | ✓ | | | |
| dart | ✓ | | ✓ | `dart` |
| dockerfile | ✓ | | | `docker-langserver` |
| elixir | ✓ | | | `elixir-ls` |
| fish | ✓ | ✓ | ✓ | |
| glsl | ✓ | | ✓ | |
Expand Down
1 change: 1 addition & 0 deletions helix-syntax/languages/tree-sitter-dockerfile
Submodule tree-sitter-dockerfile added at 7af32b
11 changes: 11 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,14 @@ file-types = ["scala", "sbt"]
comment-token = "//"
indent = { tab-width = 2, unit = " " }
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 changes: 51 additions & 0 deletions runtime/queries/dockerfile/highlights.scm
Original file line number Diff line number Diff line change
@@ -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 changes: 6 additions & 0 deletions runtime/queries/dockerfile/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
((comment) @injection.content
(#set! injection.language "comment"))

([(shell_command) (shell_fragment)] @injection.content
(#set! injection.language "bash"))