Skip to content

Commit c06f48c

Browse files
committed
fix(lsp): prefer get_clients over get_active_clients
resolves nvim-neo-tree#1551
1 parent 2a0b2c5 commit c06f48c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/neo-tree/sources/document_symbols/lib/symbols_utils.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,15 @@ local on_lsp_resp = function(lsp_resp, state)
164164
renderer.show_nodes(items, state)
165165
end
166166

167+
-- latter is deprecated in neovim v0.11
168+
local get_clients = vim.lsp.get_clients or vim.lsp.get_active_clients
167169
M.render_symbols = function(state)
168170
local bufnr = state.lsp_bufnr
169171
local bufname = state.path
170172

171173
-- if no client found, terminate
172174
local client_found = false
173-
for _, client in pairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do
175+
for _, client in pairs(get_clients({ bufnr = bufnr })) do
174176
if client.server_capabilities.documentSymbolProvider then
175177
client_found = true
176178
break

0 commit comments

Comments
 (0)