feat(nu): new attribute syntax and add folds.scm (#7650)

This commit is contained in:
zc he 2025-02-16 23:47:42 +08:00 committed by GitHub
parent b08ae25c47
commit 2cade9e3d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 9 deletions

10
queries/nu/folds.scm Normal file
View file

@ -0,0 +1,10 @@
[
(attribute_list)
(block)
(command_list)
(parameter_bracks)
(record_body)
(val_list)
(val_table)
(val_closure)
] @fold

View file

@ -275,16 +275,15 @@ key: (identifier) @property
(param_cmd (param_cmd
(cmd_identifier) @string) (cmd_identifier) @string)
(param_long_flag (attribute
(long_flag_identifier) @attribute) "@" @attribute)
(param_short_flag [
(param_short_flag_identifier) @attribute) (attribute_identifier)
(long_flag_identifier)
(short_flag (param_short_flag_identifier)
(short_flag_identifier) @attribute) (short_flag_identifier)
] @attribute
(long_flag_identifier) @attribute
(scope_pattern (scope_pattern
(wild_card) @function) (wild_card) @function)