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
|
||||
extraQueries.javascript.injections =
|
||||
extraQueries =
|
||||
let
|
||||
lang = "sql";
|
||||
langMatch = ''^//+( )*${lang}( )*|^/[*]+( )*${lang}( )*[*]+/$'';
|
||||
in
|
||||
''
|
||||
((comment) @comment .
|
||||
([ (string(string_fragment) @injection.content)
|
||||
(template_string(string_fragment) @injection.content)
|
||||
] @injection.content
|
||||
langMatch = ''^//+[ \t]*${lang}[ \t]*|^/[*]+[ \t]*${lang}[ \t]*[*]+/$'';
|
||||
javascriptInjection = ''
|
||||
((comment) @comment .
|
||||
([ (string(string_fragment) @injection.content)
|
||||
(template_string(string_fragment) @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 = {
|
||||
incremental_selection = {
|
||||
|
|
Loading…
Reference in a new issue