aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPham Huy Hoang <hoangtun0810@gmail.com>2023-08-22 09:53:11 +0900
committerGitHub <noreply@github.com>2023-08-22 09:53:11 +0900
commit2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c (patch)
treefa9e70575a07948e49351247fa213fb5ba7a78d6
parentfix: HEEx partial expression injections (diff)
downloadnvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.tar
nvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.tar.gz
nvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.tar.bz2
nvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.tar.lz
nvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.tar.xz
nvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.tar.zst
nvim-treesitter-2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c.zip
fix(lua): use include-children instead (#5299)
The root issue is fixed with neovim 0.9.2. But the current stable version is neovim 0.9.1, so partially reverts the commit to make it compatible with the current stable version.
-rw-r--r--queries/lua/injections.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/queries/lua/injections.scm b/queries/lua/injections.scm
index a426ee1b9..85c677665 100644
--- a/queries/lua/injections.scm
+++ b/queries/lua/injections.scm
@@ -33,10 +33,11 @@
(#lua-match? @injection.content "^%s*;+%s?query")
(#set! injection.language "query"))
-(comment content: (_) @injection.content
- (#lua-match? @injection.content "^[-][%s]*@")
+((comment) @injection.content
+ (#lua-match? @injection.content "^[-][-][-][%s]*@")
(#set! injection.language "luadoc")
- (#offset! @injection.content 0 1 0 0))
+ (#set! injection.include-children)
+ (#offset! @injection.content 0 3 0 0))
; string.match("123", "%d+")
@@ -86,5 +87,6 @@
(#set! injection.language "luap")
(#set! injection.include-children))))
-(comment content: (_) @injection.content
- (#set! injection.language "comment"))
+((comment) @injection.content
+ (#set! injection.language "comment")
+ (#set! injection.include-children))