Skip to content

Commit

Permalink
Merge pull request #177 from kennyp/main
Browse files Browse the repository at this point in the history
Support Multiple Args for Attributes
  • Loading branch information
tgross35 authored Oct 12, 2024
2 parents 6648ac1 + cf4b1d9 commit 390cec4
Show file tree
Hide file tree
Showing 13 changed files with 4,551 additions and 4,222 deletions.
7 changes: 6 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ module.exports = grammar({
comma_sep1(
choice(
$.identifier,
seq($.identifier, "(", field("argument", $.string), ")"),
seq(
$.identifier,
"(",
comma_sep1(field("argument", $.string)),
")",
),
),
),
"]",
Expand Down
33 changes: 19 additions & 14 deletions queries-flavored/helix/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,40 @@
left: (identifier) @keyword
(#any-of? @keyword
"allow-duplicate-recipes"
"allow-duplicate-variables"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"dotenv-required"
"export"
"fallback"
"ignore-comments"
"positional-arguments"
"shell"
"tempdi"
"shell-interpreter"
"tempdir"
"windows-powershell"
"windows-shell"))
"windows-shell"
"working-directory"))

; highlight known attributes (filtering does not always work)
(attribute
(identifier) @attribute
(#any-of? @attribute
"private"
"allow-duplicate-recipes"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"export"
"fallback"
"ignore-comments"
"confirm"
"doc"
"extension"
"group"
"linux"
"macos"
"no-cd"
"no-exit-message"
"no-quiet"
"positional-arguments"
"shell"
"tempdi"
"windows-powershell"
"windows-shell"))
"private"
"script"
"unix"
"windows"))

; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error
33 changes: 19 additions & 14 deletions queries-flavored/lapce/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,40 @@
left: (identifier) @keyword
(#any-of? @keyword
"allow-duplicate-recipes"
"allow-duplicate-variables"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"dotenv-required"
"export"
"fallback"
"ignore-comments"
"positional-arguments"
"shell"
"tempdi"
"shell-interpreter"
"tempdir"
"windows-powershell"
"windows-shell"))
"windows-shell"
"working-directory"))

; highlight known attributes (filtering does not always work)
(attribute
(identifier) @attribute
(#any-of? @attribute
"private"
"allow-duplicate-recipes"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"export"
"fallback"
"ignore-comments"
"confirm"
"doc"
"extension"
"group"
"linux"
"macos"
"no-cd"
"no-exit-message"
"no-quiet"
"positional-arguments"
"shell"
"tempdi"
"windows-powershell"
"windows-shell"))
"private"
"script"
"unix"
"windows"))

; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error
6 changes: 3 additions & 3 deletions queries-flavored/lapce/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@
(recipe_body ;
(shebang ;
(language) @injection.language)
(#not-any-of? @injection.language "python3" "nodejs" "node")
(#not-any-of? @injection.language "python3" "nodejs" "node" "uv")
(#set! injection.include-children)) @injection.content

; Transform some known executables

; python3 -> python
; python3/uv -> python
(recipe_body
(shebang
(language) @_lang)
(#eq? @_lang "python3")
(#any-of? @_lang "python3" "uv")
(#set! injection.language "python")
(#set! injection.include-children)) @injection.content

Expand Down
33 changes: 19 additions & 14 deletions queries-flavored/zed/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,40 @@
left: (identifier) @keyword
(#any-of? @keyword
"allow-duplicate-recipes"
"allow-duplicate-variables"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"dotenv-required"
"export"
"fallback"
"ignore-comments"
"positional-arguments"
"shell"
"tempdi"
"shell-interpreter"
"tempdir"
"windows-powershell"
"windows-shell"))
"windows-shell"
"working-directory"))

; highlight known attributes (filtering does not always work)
(attribute
(identifier) @attribute
(#any-of? @attribute
"private"
"allow-duplicate-recipes"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"export"
"fallback"
"ignore-comments"
"confirm"
"doc"
"extension"
"group"
"linux"
"macos"
"no-cd"
"no-exit-message"
"no-quiet"
"positional-arguments"
"shell"
"tempdi"
"windows-powershell"
"windows-shell"))
"private"
"script"
"unix"
"windows"))

; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error
6 changes: 3 additions & 3 deletions queries-flavored/zed/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@
(recipe_body ;
(shebang ;
(language) @injection.language)
(#not-any-of? @injection.language "python3" "nodejs" "node")
(#not-any-of? @injection.language "python3" "nodejs" "node" "uv")
(#set! injection.include-children)) @injection.content

; Transform some known executables

; python3 -> python
; python3/uv -> python
(recipe_body
(shebang
(language) @_lang)
(#eq? @_lang "python3")
(#any-of? @_lang "python3" "uv")
(#set! injection.language "python")
(#set! injection.include-children)) @injection.content

Expand Down
33 changes: 19 additions & 14 deletions queries-src/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -113,35 +113,40 @@
left: (identifier) @keyword
(#any-of? @keyword
"allow-duplicate-recipes"
"allow-duplicate-variables"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"dotenv-required"
"export"
"fallback"
"ignore-comments"
"positional-arguments"
"shell"
"tempdi"
"shell-interpreter"
"tempdir"
"windows-powershell"
"windows-shell"))
"windows-shell"
"working-directory"))

; highlight known attributes (filtering does not always work)
(attribute
(identifier) @attribute
(#any-of? @attribute
"private"
"allow-duplicate-recipes"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"export"
"fallback"
"ignore-comments"
"confirm"
"doc"
"extension"
"group"
"linux"
"macos"
"no-cd"
"no-exit-message"
"no-quiet"
"positional-arguments"
"shell"
"tempdi"
"windows-powershell"
"windows-shell"))
"private"
"script"
"unix"
"windows"))

; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error
6 changes: 3 additions & 3 deletions queries-src/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@
(recipe_body ; ; SKIP-HELIX
(shebang ; ; SKIP-HELIX
(language) @injection.language) ; SKIP-HELIX
(#not-any-of? @injection.language "python3" "nodejs" "node") ; SKIP-HELIX
(#not-any-of? @injection.language "python3" "nodejs" "node" "uv") ; SKIP-HELIX
(#set! injection.include-children)) @injection.content ; SKIP-HELIX
; SKIP-HELIX
; Transform some known executables ; SKIP-HELIX
; SKIP-HELIX
; python3 -> python ; SKIP-HELIX
; python3/uv -> python ; SKIP-HELIX
(recipe_body ; SKIP-HELIX
(shebang ; SKIP-HELIX
(language) @_lang) ; SKIP-HELIX
(#eq? @_lang "python3") ; SKIP-HELIX
(#any-of? @_lang "python3" "uv") ; SKIP-HELIX
(#set! injection.language "python") ; SKIP-HELIX
(#set! injection.include-children)) @injection.content ; SKIP-HELIX
; SKIP-HELIX
Expand Down
33 changes: 19 additions & 14 deletions queries/just/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,40 @@
left: (identifier) @keyword
(#any-of? @keyword
"allow-duplicate-recipes"
"allow-duplicate-variables"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"dotenv-required"
"export"
"fallback"
"ignore-comments"
"positional-arguments"
"shell"
"tempdi"
"shell-interpreter"
"tempdir"
"windows-powershell"
"windows-shell"))
"windows-shell"
"working-directory"))

; highlight known attributes (filtering does not always work)
(attribute
(identifier) @attribute
(#any-of? @attribute
"private"
"allow-duplicate-recipes"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"export"
"fallback"
"ignore-comments"
"confirm"
"doc"
"extension"
"group"
"linux"
"macos"
"no-cd"
"no-exit-message"
"no-quiet"
"positional-arguments"
"shell"
"tempdi"
"windows-powershell"
"windows-shell"))
"private"
"script"
"unix"
"windows"))

; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error
6 changes: 3 additions & 3 deletions queries/just/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@
(recipe_body ;
(shebang ;
(language) @injection.language)
(#not-any-of? @injection.language "python3" "nodejs" "node")
(#not-any-of? @injection.language "python3" "nodejs" "node" "uv")
(#set! injection.include-children)) @injection.content

; Transform some known executables

; python3 -> python
; python3/uv -> python
(recipe_body
(shebang
(language) @_lang)
(#eq? @_lang "python3")
(#any-of? @_lang "python3" "uv")
(#set! injection.language "python")
(#set! injection.include-children)) @injection.content

Expand Down
Loading

0 comments on commit 390cec4

Please sign in to comment.