treesitter_postfix snip not work for this query #1344
-
snippets: treesitter_postfix.treesitter_postfix(
{
trig = '.unlocal',
name = 'postfix unlocal',
dscr = 'expand express `local var_name = xxx` to `xxx`',
matchTSNode = {
query = [[
local_declaration: (variable_declaration
(assignment_statement
(expression_list) @exp
)
) @prefix
]],
query_lang = 'lua',
},
-- reparseBuffer = 'live',
},
fmt(
[[
{}
]],
{
l(l.LS_TSCAPTURE_EXP),
}
)
),
treesitter_postfix.treesitter_postfix(
{
matchTSNode = {
query = [[
(function_declaration
name: (identifier) @fname
parameters: (parameters) @params
body: (block) @body
) @prefix
]],
query_lang = 'lua',
},
trig = '.var',
},
fmt(
[[
local {} = function{}
{}
end
]],
{
l(l.LS_TSCAPTURE_FNAME),
l(l.LS_TSCAPTURE_PARAMS),
l(l.LS_TSCAPTURE_BODY),
}
)
), test.lua local a = "a"
function f(param)
body()
end use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi :)
|
Beta Was this translation helpful? Give feedback.
In the video, you use some completion engine to expand the snippet, have you tried manual expansion for
unlocal
?