merge conflicts

pull/167/head
ray-x 2 years ago
parent c9d97f6bef
commit d62d187cb9

@ -272,20 +272,4 @@ function M.inside_function()
return false
end
function M.inside_function()
local current_node = ts_utils.get_node_at_cursor()
if not current_node then
return false
end
local expr = current_node
while expr do
if expr:type() == "function_declaration" or expr:type() == "method_declaration" then
return true
end
expr = expr:parent()
end
return false
end
return M

@ -163,6 +163,28 @@ for {{
ls.i(0, ""),
})
),
ls.s(
{ trig = "for([%w_]+)", regTrig = true, hidden = true },
fmt(
[[
for {} := 0; {} < {}; {}++ {{
{}
}}
{}
]],
{
ls.d(1, function(_, snip)
return ls.sn(1, ls.i(1, snip.captures[1]))
end),
rep(1),
ls.c(2, { ls.i(1, "num"), ls.sn(1, { ls.t("len("), ls.i(1, "arr"), ls.t(")") }) }),
rep(1),
ls.i(3, "// TODO:"),
ls.i(4),
}
), in_fn
),
-- type switch
ls.s(
{ trig = "tysw", dscr = "type switch" },

Loading…
Cancel
Save