neovim: add sql injection for typescript
This commit is contained in:
parent
596b3213d6
commit
e3c55b0e1e
1 changed files with 16 additions and 12 deletions
|
@ -68,21 +68,25 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
# Source: https://github.com/DariusCorvus/tree-sitter-language-injection.nvim/blob/main/lua/tree-sitter-language-injection/init.lua
|
# Source: https://github.com/DariusCorvus/tree-sitter-language-injection.nvim/blob/main/lua/tree-sitter-language-injection/init.lua
|
||||||
extraQueries.javascript.injections =
|
extraQueries =
|
||||||
let
|
let
|
||||||
lang = "sql";
|
lang = "sql";
|
||||||
langMatch = ''^//+( )*${lang}( )*|^/[*]+( )*${lang}( )*[*]+/$'';
|
langMatch = ''^//+[ \t]*${lang}[ \t]*|^/[*]+[ \t]*${lang}[ \t]*[*]+/$'';
|
||||||
in
|
javascriptInjection = ''
|
||||||
''
|
((comment) @comment .
|
||||||
((comment) @comment .
|
([ (string(string_fragment) @injection.content)
|
||||||
([ (string(string_fragment) @injection.content)
|
(template_string(string_fragment) @injection.content)
|
||||||
(template_string(string_fragment) @injection.content)
|
] @injection.content
|
||||||
] @injection.content
|
)
|
||||||
|
(#match? @comment "${langMatch}")
|
||||||
|
(#set! injection.language "${lang}")
|
||||||
)
|
)
|
||||||
(#match? @comment "${langMatch}")
|
'';
|
||||||
(#set! injection.language "${lang}")
|
in
|
||||||
)
|
{
|
||||||
'';
|
javascript.injections = javascriptInjection;
|
||||||
|
typescript.injections = javascriptInjection;
|
||||||
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue