mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 19:00:02 -04:00
feat(lua): add injections for vim.filetype.add
This commit is contained in:
parent
33c9db832b
commit
7051a72755
1 changed files with 18 additions and 0 deletions
|
|
@ -177,3 +177,21 @@
|
||||||
(comment
|
(comment
|
||||||
content: (_) @injection.content
|
content: (_) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
|
; vim.filetype.add({ pattern = { ["some lua pattern here"] = "filetype" } })
|
||||||
|
((function_call
|
||||||
|
name: (_) @_filetypeadd_identifier
|
||||||
|
arguments:
|
||||||
|
(arguments
|
||||||
|
(table_constructor
|
||||||
|
(field
|
||||||
|
name: (_) @_pattern_key
|
||||||
|
value:
|
||||||
|
(table_constructor
|
||||||
|
(field
|
||||||
|
name:
|
||||||
|
(string
|
||||||
|
content: _ @injection.content)))))))
|
||||||
|
(#set! injection.language "luap")
|
||||||
|
(#eq? @_filetypeadd_identifier "vim.filetype.add")
|
||||||
|
(#eq? @_pattern_key "pattern"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue