aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-03-16 03:41:31 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-03-20 03:13:41 -0400
commit581fc14cea6e85c710ece75f89f17dffd816fbc4 (patch)
tree42993996790cea8ed4d60e60ab92c8771a27311b
parentfix(lua): properly highlight labels (diff)
downloadnvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.tar
nvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.tar.gz
nvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.tar.bz2
nvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.tar.lz
nvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.tar.xz
nvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.tar.zst
nvim-treesitter-581fc14cea6e85c710ece75f89f17dffd816fbc4.zip
queries(lua): add more keywords related to variable/function builtins, debug, and coroutines
-rw-r--r--queries/lua/highlights.scm12
1 files changed, 9 insertions, 3 deletions
diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm
index 38f926a0d..5fbf8a183 100644
--- a/queries/lua/highlights.scm
+++ b/queries/lua/highlights.scm
@@ -128,7 +128,10 @@
(identifier) @variable
((identifier) @variable.builtin
- (#any-of? @variable.builtin "self" "string" "table" "vim"))
+ (#any-of? @variable.builtin "_G" "_VERSION" "debug" "io" "jit" "math" "os" "package" "self" "string" "table" "utf8"))
+
+((identifier) @keyword.coroutine
+ (#eq? @keyword.coroutine "coroutine"))
(variable_list
attribute: (attribute
@@ -185,8 +188,11 @@
;; built-in functions in Lua 5.1
"assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable" "ipairs"
"load" "loadfile" "loadstring" "module" "next" "pairs" "pcall" "print"
- "rawequal" "rawget" "rawset" "require" "select" "setfenv" "setmetatable"
- "tonumber" "tostring" "type" "unpack" "xpcall"))
+ "rawequal" "rawget" "rawlen" "rawset" "require" "select" "setfenv" "setmetatable"
+ "tonumber" "tostring" "type" "unpack" "xpcall"
+ "__add" "__band" "__bnot" "__bor" "__bxor" "__call" "__concat" "__div" "__eq" "__gc"
+ "__idiv" "__index" "__le" "__len" "__lt" "__metatable" "__mod" "__mul" "__name" "__newindex"
+ "__pairs" "__pow" "__shl" "__shr" "__sub" "__tostring" "__unm"))
;; Others