From adafa8c38cb6a36ba866f95652347cebcfcda7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Lehmann?= Date: Wed, 17 Apr 2024 08:54:46 +0200 Subject: [PATCH 1/2] update tree-sitter-earthfile to 0.2.4 --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 51610de6c5a5..5ac2b2fe6577 100644 --- a/languages.toml +++ b/languages.toml @@ -3503,7 +3503,7 @@ language-servers = ["earthlyls"] [[grammar]] name = "earthfile" -source = { git = "https://github.com/glehmann/tree-sitter-earthfile", rev = "2a6ab191f5f962562e495a818aa4e7f45f8a556a" } +source = { git = "https://github.com/glehmann/tree-sitter-earthfile", rev = "a079e6c472eeedd6b9a1e03ca0b6c82cd6a112a4" } [[language]] name = "adl" From eb6dd28c323c9a3f275fcd011b226f8a0d57de43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Lehmann?= Date: Wed, 17 Apr 2024 08:56:38 +0200 Subject: [PATCH 2/2] =?UTF-8?q?update=20earthfile=20hig=E1=B8=A5light=20qu?= =?UTF-8?q?eries=20based=20on=20nvim-treesitter=20feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/queries/earthfile/highlights.scm | 70 ++++++++++++------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/runtime/queries/earthfile/highlights.scm b/runtime/queries/earthfile/highlights.scm index a0191174fea1..2de8670f842a 100644 --- a/runtime/queries/earthfile/highlights.scm +++ b/runtime/queries/earthfile/highlights.scm @@ -1,42 +1,48 @@ (string_array "," @punctuation.delimiter) (string_array ["[" "]"] @punctuation.bracket) -(arg_command "ARG" @keyword) -(build_command "BUILD" @keyword) -(cache_command "CACHE" @keyword) -(cmd_command "CMD" @keyword) -(copy_command "COPY" @keyword) -(do_command "DO" @keyword) -(entrypoint_command "ENTRYPOINT" @keyword) -(env_command "ENV" @keyword) -(expose_command "EXPOSE" @keyword) -(from_command "FROM" @keyword) -(from_dockerfile_command "FROM DOCKERFILE" @keyword) -(function_command "FUNCTION" @keyword) -(git_clone_command "GIT CLONE" @keyword) -(host_command "HOST" @keyword) -(import_command "IMPORT" @keyword) -(label_command "LABEL" @keyword) -(let_command "LET" @keyword) -(project_command "PROJECT" @keyword) -(run_command "RUN" @keyword) -(save_artifact_command ["SAVE ARTIFACT" "AS LOCAL"] @keyword) -(save_image_command "SAVE IMAGE" @keyword) -(set_command "SET" @keyword) -(user_command "USER" @keyword) -(version_command "VERSION" @keyword) -(volume_command "VOLUME" @keyword) -(with_docker_command "WITH DOCKER" @keyword) -(workdir_command "WORKDIR" @keyword) +[ + "ARG" + "AS LOCAL" + "BUILD" + "CACHE" + "CMD" + "COPY" + "DO" + "ENTRYPOINT" + "ENV" + "EXPOSE" + "FROM DOCKERFILE" + "FROM" + "FUNCTION" + "GIT CLONE" + "HOST" + "IMPORT" + "LABEL" + "LET" + "PROJECT" + "RUN" + "SAVE ARTIFACT" + "SAVE IMAGE" + "SET" + "USER" + "VERSION" + "VOLUME" + "WORKDIR" +] @keyword (for_command ["FOR" "IN" "END"] @keyword.control.repeat) + (if_command ["IF" "END"] @keyword.control.conditional) (elif_block ["ELSE IF"] @keyword.control.conditional) (else_block ["ELSE"] @keyword.control.conditional) + (import_command ["IMPORT" "AS"] @keyword.control.import) + (try_command ["TRY" "FINALLY" "END"] @keyword.control.exception) -(wait_command ["WAIT" "END"] @keyword.control) +(wait_command ["WAIT" "END"] @keyword.control) +(with_docker_command ["WITH DOCKER" "END"] @keyword.control) [ (comment) @@ -65,10 +71,4 @@ (build_arg) @variable (options (_) @variable.parameter) -(options (_ "=" @operator)) -(build_arg "=" @operator) -(arg_command "=" @operator) -(env_command "=" @operator) -(label "=" @operator) -(set_command "=" @operator) -(let_command "=" @operator) +"=" @operator