feat(nu)!: update parser and queries

This commit is contained in:
Christian Clason 2025-08-25 19:19:32 +02:00 committed by Christian Clason
parent 37cec5ec59
commit 85ec015f3b
2 changed files with 22 additions and 32 deletions

View file

@ -1479,7 +1479,7 @@ return {
}, },
nu = { nu = {
install_info = { install_info = {
revision = '6544c4383643cf8608d50def2247a7af8314e148', revision = 'cc4624fbc6ec3563d98fbe8f215a8b8e10b16f32',
url = 'https://github.com/nushell/tree-sitter-nu', url = 'https://github.com/nushell/tree-sitter-nu',
}, },
maintainers = { '@abhisheksingh0x558' }, maintainers = { '@abhisheksingh0x558' },

View file

@ -2,13 +2,8 @@
; keywords ; keywords
[ [
"let" "let"
"let-env"
"mut" "mut"
"const" "const"
"hide-env"
"source"
"source-env"
"overlay"
] @keyword ] @keyword
[ [
@ -20,16 +15,9 @@
[ [
"loop" "loop"
"while" "while"
"break"
"continue"
] @keyword.repeat ] @keyword.repeat
[ "def" @keyword.function
"def"
"do"
] @keyword.function
"return" @keyword.return
[ [
"try" "try"
@ -49,9 +37,6 @@
"extern" "extern"
] @keyword.modifier ] @keyword.modifier
(hide_mod
"hide" @keyword)
(decl_use (decl_use
module: (unquoted) @module) module: (unquoted) @module)
@ -59,21 +44,6 @@
"for" @keyword "for" @keyword
"in" @keyword) "in" @keyword)
(overlay_list
"list" @keyword.import)
(overlay_hide
"hide" @keyword.import)
(overlay_new
"new" @keyword.import)
(overlay_use
"as" @keyword)
(ctrl_error
"make" @keyword.import)
; --- ; ---
; literals ; literals
(val_number) @number (val_number) @number
@ -316,6 +286,26 @@ key: (identifier) @property
"zip") "zip")
]) ])
(command
head: (cmd_identifier) @keyword
(#any-of? @keyword "do" "source" "source-env" "hide" "hide-env"))
(command
head: (cmd_identifier) @keyword.repeat
(#any-of? @keyword.repeat "break" "continue" "return"))
(command
head: (cmd_identifier) @keyword
.
arg_str: (val_string) @keyword.import
(#any-of? @keyword "overlay" "error"))
(command
head: (cmd_identifier) @_cmd
arg_str: (val_string) @keyword
(#eq? @_cmd "overlay")
(#eq? @keyword "as"))
(command (command
"^" @punctuation.delimiter "^" @punctuation.delimiter
head: (_) @function) head: (_) @function)