Skip to content

Commit

Permalink
feat(keywords) merge return and yield into keyword.return group
Browse files Browse the repository at this point in the history
  • Loading branch information
antonk52 authored and theHamsta committed Jul 4, 2021
1 parent bd9095e commit 90f15d9
Show file tree
Hide file tree
Showing 23 changed files with 20 additions and 69 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ effect on highlighting. We will work on improving highlighting in the near futur
@keyword.function
@keyword.operator (for operators that are English words, e.g. `and`, `or`)
@keyword.return
@keyword.yield
@operator (for symbolic operators, e.g. `+`, `*`)
@exception
@include keywords for including modules (e.g. import/from in Python)
Expand Down
6 changes: 1 addition & 5 deletions doc/nvim-treesitter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,7 @@ for operators that are English words, e.g. `and`, `as`, `or`.

*hl-TSKeywordReturn*
`TSKeywordReturn`
for the `return` keyword.

*hl-TSKeywordYield*
`TSKeywordYield`
for the `yield` keyword.
for the `return` and `yield` keywords.

*hl-TSLabel*
`TSLabel`
Expand Down
1 change: 0 additions & 1 deletion lua/nvim-treesitter/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ hlmap["keyword"] = "TSKeyword"
hlmap["keyword.function"] = "TSKeywordFunction"
hlmap["keyword.operator"] = "TSKeywordOperator"
hlmap["keyword.return"] = "TSKeywordReturn"
hlmap["keyword.yield"] = "TSKeywordYield"

hlmap["label"] = "TSLabel"

Expand Down
1 change: 0 additions & 1 deletion plugin/nvim-treesitter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ highlight default link TSKeyword Keyword
highlight default link TSKeywordFunction Keyword
highlight default link TSKeywordOperator TSOperator
highlight default link TSKeywordReturn TSKeyword
highlight default link TSKeywordYield TSKeyword
highlight default link TSException Exception

highlight default link TSType Type
Expand Down
4 changes: 1 addition & 3 deletions queries/c/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"register"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

[
"while"
Expand Down
5 changes: 1 addition & 4 deletions queries/c_sharp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@

[
"return"
] @keyword.return

[
"yield"
] @keyword.yield
] @keyword.return

5 changes: 1 addition & 4 deletions queries/dart/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@

[
"return"
"yield"
] @keyword.return


Expand Down Expand Up @@ -218,10 +219,6 @@
"typedef"
] @keyword

[
"yield"
] @keyword.yield

; when used as an identifier:
((identifier) @variable.builtin
(#any-of? @variable.builtin
Expand Down
5 changes: 1 addition & 4 deletions queries/ecma/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,8 @@

[
"return"
] @keyword.return

[
"yield"
] @keyword.yield
] @keyword.return

[
"function"
Expand Down
4 changes: 1 addition & 3 deletions queries/fish/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@
(continue)
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

;; Punctuation

Expand Down
4 changes: 1 addition & 3 deletions queries/fortran/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
(procedure_qualifier)
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

[
"else"
Expand Down
4 changes: 1 addition & 3 deletions queries/gdscript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,4 @@
"puppetsync"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return
4 changes: 1 addition & 3 deletions queries/go/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@
"fallthrough"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

"for" @repeat

Expand Down
5 changes: 1 addition & 4 deletions queries/java/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,8 @@

[
"return"
] @keyword.return

[
"yield"
] @keyword.yield
] @keyword.return

[
"new"
Expand Down
4 changes: 1 addition & 3 deletions queries/julia/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@
"type"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

((identifier) @keyword (#any-of? @keyword "global" "local"))

Expand Down
4 changes: 1 addition & 3 deletions queries/kotlin/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@
"throw"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

(null_literal) @keyword

Expand Down
4 changes: 1 addition & 3 deletions queries/lua/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
"goto"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

;; Operators

Expand Down
4 changes: 1 addition & 3 deletions queries/php/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@
"trait"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

[
"case"
Expand Down
5 changes: 1 addition & 4 deletions queries/python/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,8 @@

[
"return"
] @keyword.return

[
"yield"
] @keyword.yield
] @keyword.return

["from" "import"] @include
(aliased_import "as" @include)
Expand Down
5 changes: 1 addition & 4 deletions queries/ruby/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@

[
"return"
] @keyword.return

[
"yield"
] @keyword.yield
] @keyword.return

[
"and"
Expand Down
4 changes: 1 addition & 3 deletions queries/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@
(super)
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

"fn" @keyword.function

Expand Down
2 changes: 1 addition & 1 deletion queries/teal/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[ "if" "then" "elseif" "else" ] @conditional
[ "for" "while" "repeat" "until" ] @repeat
[ "in" "local" (break) (goto) "do" "end" ] @keyword
[ "return" ] @keyword.return
"return" @keyword.return
(label) @label

;; Global isn't a real keyword, but it gets special treatment in these places
Expand Down
4 changes: 1 addition & 3 deletions queries/verilog/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
"assert"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

[
"begin"
Expand Down
4 changes: 1 addition & 3 deletions queries/zig/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@
"while"
] @keyword

[
"return"
] @keyword.return
"return" @keyword.return

"fn" @keyword.function

Expand Down

0 comments on commit 90f15d9

Please sign in to comment.