Skip to content

Commit

Permalink
plugins/treesitter: injections support luaConfig strings
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 6, 2025
1 parent 31139e0 commit 65d0820
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions plugins/by-name/treesitter/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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$"))

0 comments on commit 65d0820

Please sign in to comment.