Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Aug 31, 2023
1 parent 9a6b37f commit 4243d25
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lua/luasnip/extras/treesitter_postfix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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,
},
},
Expand Down

0 comments on commit 4243d25

Please sign in to comment.