Skip to content

Commit

Permalink
remove unused (?) fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
L3MON4D3 committed Sep 15, 2023
1 parent 09855a8 commit 6b72bb6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lua/luasnip/extras/_treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ local builtin_tsnode_selectors = {
---@class LuaSnip.extra.TSParser
---@field parser LanguageTree
---@field source string|number
---@field ori_buf number
---@field buf_lang string
local TSParser = {}

---@param bufnr number?
Expand All @@ -249,28 +247,21 @@ local TSParser = {}
---@return LuaSnip.extra.TSParser?
function TSParser.new(bufnr, parser, source)
bufnr = bufnr or vim.api.nvim_get_current_buf()
local buf_lang = get_lang(bufnr)
if buf_lang == nil then
return
end

local o = {
parser = parser,
source = source,
ori_buf = bufnr,
buf_lang = buf_lang,
}

setmetatable(o, {
__index = TSParser,
---@param self LuaSnip.extra.TSParser
---@return string
__tostring = function(self)
return ("trees: %d, source: %s, lang: %s"):format(
return ("trees: %d, source: %s"):format(
#self.parser:trees(),
type(self.source) == "number" and tostring(self.source)
or "[COPYED]",
buf_lang
or "[COPIED]"
)
end,
})
Expand Down

0 comments on commit 6b72bb6

Please sign in to comment.