From 5cbcd25be9dc4d398dbcd83c78589045a507ec48 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 11 Mar 2024 17:51:35 -0400 Subject: [PATCH] Change shebang to a keyword directive --- build-flavored-queries.py | 1 + queries-flavored/helix/highlights.scm | 4 ++-- queries-flavored/lapce/highlights.scm | 4 ++-- queries-flavored/nvim-next/highlights.scm | 4 ++-- queries-flavored/zed/highlights.scm | 4 ++-- queries-src/highlights.scm | 4 ++-- queries/just/highlights.scm | 2 +- test/highlight/recipes.just | 4 ++-- test/highlight/statements.just | 2 +- 9 files changed, 15 insertions(+), 14 deletions(-) diff --git a/build-flavored-queries.py b/build-flavored-queries.py index 2c45f4f..55cd8f4 100755 --- a/build-flavored-queries.py +++ b/build-flavored-queries.py @@ -196,6 +196,7 @@ (r"@keyword.control.conditional", r"@conditional"), (r"@keyword.control.import", r"@keyword"), (r"@keyword.module", r"@keyword"), + (r"@keyword.directive", r"@comment"), (r"@variable.parameter", r"@parameter"), # Changes to indent queries (r"@indent\s+@extend", r"@indent.begin"), diff --git a/queries-flavored/helix/highlights.scm b/queries-flavored/helix/highlights.scm index 7214ebd..178cae1 100644 --- a/queries-flavored/helix/highlights.scm +++ b/queries-flavored/helix/highlights.scm @@ -78,7 +78,7 @@ ; Punctuation -[ "," ] @punctuation.delimiter +"," @punctuation.delimiter [ "{" @@ -108,7 +108,7 @@ (comment) @comment.line -(shebang) @comment +(shebang) @keyword.directive ; highlight known settings (filtering does not always work) (setting diff --git a/queries-flavored/lapce/highlights.scm b/queries-flavored/lapce/highlights.scm index 7214ebd..178cae1 100644 --- a/queries-flavored/lapce/highlights.scm +++ b/queries-flavored/lapce/highlights.scm @@ -78,7 +78,7 @@ ; Punctuation -[ "," ] @punctuation.delimiter +"," @punctuation.delimiter [ "{" @@ -108,7 +108,7 @@ (comment) @comment.line -(shebang) @comment +(shebang) @keyword.directive ; highlight known settings (filtering does not always work) (setting diff --git a/queries-flavored/nvim-next/highlights.scm b/queries-flavored/nvim-next/highlights.scm index 1048d26..68e03e3 100644 --- a/queries-flavored/nvim-next/highlights.scm +++ b/queries-flavored/nvim-next/highlights.scm @@ -78,7 +78,7 @@ ; Punctuation -[ "," ] @punctuation.delimiter +"," @punctuation.delimiter [ "{" @@ -108,7 +108,7 @@ (comment) @spell @comment -(shebang) @comment +(shebang) @keyword.directive ; highlight known settings (filtering does not always work) (setting diff --git a/queries-flavored/zed/highlights.scm b/queries-flavored/zed/highlights.scm index 7214ebd..178cae1 100644 --- a/queries-flavored/zed/highlights.scm +++ b/queries-flavored/zed/highlights.scm @@ -78,7 +78,7 @@ ; Punctuation -[ "," ] @punctuation.delimiter +"," @punctuation.delimiter [ "{" @@ -108,7 +108,7 @@ (comment) @comment.line -(shebang) @comment +(shebang) @keyword.directive ; highlight known settings (filtering does not always work) (setting diff --git a/queries-src/highlights.scm b/queries-src/highlights.scm index ef49bfa..4e57ed5 100644 --- a/queries-src/highlights.scm +++ b/queries-src/highlights.scm @@ -76,7 +76,7 @@ ; Punctuation -[ "," ] @punctuation.delimiter +"," @punctuation.delimiter [ "{" @@ -106,7 +106,7 @@ (comment) @spell @comment.line -(shebang) @comment +(shebang) @keyword.directive ; highlight known settings (filtering does not always work) (setting diff --git a/queries/just/highlights.scm b/queries/just/highlights.scm index 4777fa7..852ace7 100644 --- a/queries/just/highlights.scm +++ b/queries/just/highlights.scm @@ -78,7 +78,7 @@ ; Punctuation -[ "," ] @punctuation.delimiter +"," @punctuation.delimiter [ "{" diff --git a/test/highlight/recipes.just b/test/highlight/recipes.just index ecea20e..f0a6ad8 100644 --- a/test/highlight/recipes.just +++ b/test/highlight/recipes.just @@ -1,6 +1,6 @@ #!/use/bin/env just -# <- comment -# ^^^^^^^^^^^^^^^^^ comment +# <- keyword.directive +# ^^^^^^^^^^^^^^^^^ keyword.directive foo: # <- function diff --git a/test/highlight/statements.just b/test/highlight/statements.just index a18c164..622fbc0 100644 --- a/test/highlight/statements.just +++ b/test/highlight/statements.just @@ -1,5 +1,5 @@ #!/usr/bin/env just -# <- comment +# <- keyword.directive foo := "abc" # <- variable