diff --git a/lua/luasnip/extras/treesitter_postfix.lua b/lua/luasnip/extras/treesitter_postfix.lua index ca99453ec..9793d6845 100644 --- a/lua/luasnip/extras/treesitter_postfix.lua +++ b/lua/luasnip/extras/treesitter_postfix.lua @@ -251,11 +251,6 @@ local function generate_simple_parent_lookup_function(lookup_fun) end end -local find_topmost_types = - generate_simple_parent_lookup_function(ts.find_topmost_parent) -local find_first_types = - generate_simple_parent_lookup_function(ts.find_first_parent) - ---@param n number local function find_nth_parent(n) ---@param parser LuaSnip.extra.TSParser @@ -290,8 +285,6 @@ local function treesitter_postfix(context, nodes, opts) }) context = node_util.wrap_context(context) - context.wordTrig = false - context.trigEngine = "plain" ---@type string|string[]|LuaSnip.extra.MatchTSNodeOpts|LuaSnip.extra.MatchTSNodeFunc local match_tsnode = context.matchTSNode local user_resolve = context.resolveExpandParams @@ -312,8 +305,12 @@ return { treesitter_postfix = treesitter_postfix, builtin = { tsnode_matcher = { - find_topmost_types = find_topmost_types, - find_first_types = find_first_types, + find_topmost_types = generate_simple_parent_lookup_function( + ts.find_topmost_parent + ), + find_first_types = generate_simple_parent_lookup_function( + ts.find_first_parent + ), find_nth_parent = find_nth_parent, }, },