mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(python): highlight modules
This commit is contained in:
parent
fb12c7f8a3
commit
8a74ac9aea
2 changed files with 21 additions and 2 deletions
|
|
@ -310,7 +310,7 @@
|
||||||
|
|
||||||
(future_import_statement
|
(future_import_statement
|
||||||
"from" @keyword.import
|
"from" @keyword.import
|
||||||
"__future__" @constant.builtin)
|
"__future__" @module.builtin)
|
||||||
|
|
||||||
(import_from_statement
|
(import_from_statement
|
||||||
"from" @keyword.import)
|
"from" @keyword.import)
|
||||||
|
|
@ -323,6 +323,25 @@
|
||||||
(wildcard_import
|
(wildcard_import
|
||||||
"*" @character.special)
|
"*" @character.special)
|
||||||
|
|
||||||
|
(import_statement
|
||||||
|
name: (dotted_name
|
||||||
|
(identifier) @module))
|
||||||
|
|
||||||
|
(import_statement
|
||||||
|
name: (aliased_import
|
||||||
|
name: (dotted_name
|
||||||
|
(identifier) @module)
|
||||||
|
alias: (identifier) @module))
|
||||||
|
|
||||||
|
(import_from_statement
|
||||||
|
module_name: (dotted_name
|
||||||
|
(identifier) @module))
|
||||||
|
|
||||||
|
(import_from_statement
|
||||||
|
module_name: (relative_import
|
||||||
|
(dotted_name
|
||||||
|
(identifier) @module)))
|
||||||
|
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
"elif"
|
"elif"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
# ^ @keyword.import
|
# ^ @keyword.import
|
||||||
# ^ @constant.builtin
|
# ^ @module.builtin
|
||||||
# ^ @keyword.import
|
# ^ @keyword.import
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue