-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lang): add nushell language support (#2225)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
- Loading branch information
1 parent
3c250b7
commit 5c25705
Showing
6 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
(function_definition) | ||
(block) | ||
] @fold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
(string) @string | ||
(type) @type | ||
(value_path) @variable | ||
(comment) @comment | ||
|
||
(number_literal) @constant.numeric | ||
(range from: (number_literal) @constant.numeric) | ||
(range to: (number_literal) @constant.numeric) | ||
|
||
(command cmd_name: (identifier) @function) | ||
(function_definition func_name: (identifier) @function) | ||
|
||
[ | ||
(variable_declaration name: (identifier)) | ||
(parameter (identifier)) | ||
(flag (flag_name)) | ||
(flag (flag_shorthand_name)) | ||
(record_entry entry_name: (identifier)) | ||
(block_args block_param: (identifier)) | ||
] @variable.other.member | ||
; (parameter (identifier) @variable.parameter) ; -- alternative highlighting group? | ||
|
||
(cmd_invocation) @embedded | ||
|
||
|
||
((identifier) @constant | ||
(#match? @constant "^[A-Z][A-Z\\d_]*$")) | ||
|
||
[ | ||
"if" | ||
"else" | ||
"let" | ||
"def" | ||
"export" | ||
] @keyword | ||
|
||
[ | ||
; "/" Not making / an operator may lead to better highlighting? | ||
"$" | ||
"|" | ||
"+" | ||
"-" | ||
"*" | ||
"=" | ||
"!=" | ||
"&&" | ||
"||" | ||
"==" | ||
">" | ||
] @operator | ||
|
||
["." | ||
"," | ||
";" | ||
] @punctuation.delimiter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
((comment) @injection.content | ||
(#set! injection.language "comment")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; Scopes | ||
(function_definition) @scope | ||
|
||
; Definitions | ||
(variable_declaration | ||
name: (identifier) @definition.var) | ||
|
||
(function_definition | ||
func_name: (identifier) @definition.function) | ||
|
||
; References | ||
(value_path) @reference | ||
(word) @reference |