From cb62b3c9dfc8824095f634fcf333667b3f759716 Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 16 May 2024 21:11:19 +0800 Subject: [PATCH] update deprecate function for 0.10 release --- lua/lspsaga/definition.lua | 3 ++- lua/lspsaga/hover.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lspsaga/definition.lua b/lua/lspsaga/definition.lua index 276b907bf..bfa038841 100644 --- a/lua/lspsaga/definition.lua +++ b/lua/lspsaga/definition.lua @@ -4,6 +4,7 @@ local util = require('lspsaga.util') local win = require('lspsaga.window') local buf_del_keymap = api.nvim_buf_del_keymap local beacon = require('lspsaga.beacon').jump_beacon +local islist = util.is_ten and vim.islist or vim.tbl_islist local def = {} def.__index = def @@ -227,7 +228,7 @@ function def:definition_request(method, handler_T, args) fn.settagstack(api.nvim_get_current_win(), { items = items }, 't') local res - if not vim.tbl_islist(result) then + if not islist(result) then res = result elseif result[1] then res = result[1] diff --git a/lua/lspsaga/hover.lua b/lua/lspsaga/hover.lua index a32f11ab9..acb239a31 100644 --- a/lua/lspsaga/hover.lua +++ b/lua/lspsaga/hover.lua @@ -3,6 +3,7 @@ local config = require('lspsaga').config local win = require('lspsaga.window') local util = require('lspsaga.util') local treesitter = vim.treesitter +local islist = util.is_ten and vim.islist or vim.tbl_islist local hover = {} function hover:clean() @@ -250,7 +251,7 @@ function hover:do_request(args) else value = result.contents.value end - elseif vim.tbl_islist(result.contents) then -- MarkedString[] + elseif islist(result.contents) then -- MarkedString[] if vim.tbl_isempty(result.contents) and ignore_error(args) then vim.notify('No information available') return