aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-05-17 17:07:27 +0200
committerStephan Seitz <stephan.seitz@fau.de>2020-05-17 21:56:44 +0200
commitf6bf56974ea3ee4a2640c9ddd1b42c20a53188cc (patch)
treedcd629aa8de6bf684c9806ddb40c98b676d1b886
parentAdd python/highlights.scm from tree-sitter-python (diff)
downloadnvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.tar
nvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.tar.gz
nvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.tar.bz2
nvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.tar.lz
nvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.tar.xz
nvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.tar.zst
nvim-treesitter-f6bf56974ea3ee4a2640c9ddd1b42c20a53188cc.zip
Introduce `@include`
-rw-r--r--CONTRIBUTING.md1
-rw-r--r--lua/nvim-treesitter/highlight.lua1
-rw-r--r--queries/python/highlights.scm6
3 files changed, 5 insertions, 3 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5335d04ea..ea31f573e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -79,6 +79,7 @@ are optional and will not have any effect for now.
`@operator`
`@keyword`
`@exception`
+`@include` keywords for including modules (e.g. import/from in Python)
`@type`
`builtin`
diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua
index c1981aff8..ac46010bb 100644
--- a/lua/nvim-treesitter/highlight.lua
+++ b/lua/nvim-treesitter/highlight.lua
@@ -47,6 +47,7 @@ hlmap["exception"] = "Exception"
hlmap["type"] = "Type"
hlmap["type.builtin"] = "Type"
hlmap["structure"] = "Structure"
+hlmap["include"] = "Include"
function M.attach(bufnr, ft)
local buf = bufnr or api.nvim_get_current_buf()
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index f953efd0c..4cd8b8998 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -103,7 +103,7 @@
; Keywords
-"as" @keyword
+"as" @include
"assert" @keyword
"async" @keyword
"await" @keyword
@@ -118,10 +118,10 @@
"exec" @keyword
"finally" @keyword
"for" @repeat
-"from" @keyword
+"from" @include
"global" @keyword
"if" @conditional
-"import" @keyword
+"import" @include
"lambda" @keyword
"nonlocal" @keyword
"pass" @keyword