mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 21:10:15 -04:00
highlights(python): "from" in yield should be @keyword.return
Fixes #2712
This commit is contained in:
parent
4b9aec69bd
commit
b8d1c2445a
2 changed files with 11 additions and 1 deletions
|
|
@ -226,8 +226,11 @@
|
|||
"return"
|
||||
"yield"
|
||||
] @keyword.return
|
||||
(yield "from" @keyword.return)
|
||||
|
||||
(import_from_statement "from" @include)
|
||||
"import" @include
|
||||
|
||||
["from" "import"] @include
|
||||
(aliased_import "as" @include)
|
||||
|
||||
["if" "elif" "else" "match" "case"] @conditional
|
||||
|
|
|
|||
7
tests/query/highlights/python/yield_from.py
Normal file
7
tests/query/highlights/python/yield_from.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from foo import bar
|
||||
# ^ @include
|
||||
# ^ @include
|
||||
def generator():
|
||||
yield from bar(42)
|
||||
# ^ @keyword.return
|
||||
# ^ @keyword.return
|
||||
Loading…
Add table
Add a link
Reference in a new issue