plugins/treesitter: injections support luaConfig strings

This commit is contained in:
Austin Horstman 2025-01-02 18:06:40 -06:00
parent 31139e0605
commit 65d082069e
No known key found for this signature in database

View file

@ -38,3 +38,39 @@
(#set! injection.language "vim")))
]
(#match? @_path "(^extraConfigVim(Pre|Post)?)$"))
(binding
attrpath: (attrpath
(identifier) @namespace
(identifier) @name)
expression: [
(string_expression
((string_fragment) @injection.content
(#set! injection.language "lua")))
(indented_string_expression
((string_fragment) @injection.content
(#set! injection.language "lua")))
]
(#match? @namespace "^luaConfig$")
(#match? @name "^(pre|post|content)$"))
(binding
attrpath: (attrpath
(identifier) @_path)
expression: [
(attrset_expression
(binding_set
(binding
attrpath: (attrpath
(identifier) @_nested_path)
expression: [
(string_expression
((string_fragment) @injection.content
(#set! injection.language "lua")))
(indented_string_expression
((string_fragment) @injection.content
(#set! injection.language "lua")))
]
(#match? @_nested_path "^(pre|post|content)$"))))
]
(#match? @_path "^luaConfig$"))