Revert "fix(treesitter): should convert obj to string before matching (#203)"

This reverts commit 77e13c67f6.
This commit is contained in:
kevinhwang91 2024-02-27 21:08:58 +08:00
parent 77e13c67f6
commit 239ae620d8
2 changed files with 2 additions and 2 deletions

View file

@ -35,7 +35,7 @@ local function selectProviderWithChainByDefault()
---@return Promise
local function customizeSelector(bufnr)
local function handleFallbackException(err, providerName)
if tostring(err):match('UfoFallbackException') then
if type(err) == 'string' and err:match('UfoFallbackException') then
return require('ufo').getFolds(bufnr, providerName)
else
return require('promise').reject(err)

View file

@ -13,7 +13,7 @@ local Provider = {
}
local function needFallback(reason)
return tostring(reason):match('UfoFallbackException') ~= nil
return type(reason) == 'string' and reason:match('UfoFallbackException')
end
function Provider:getFunction(m)