aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/buf.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-10-24 11:34:17 +0100
committerLewis Russell <me@lewisr.dev>2024-10-24 13:15:25 +0100
commitc8d7d65679f832b406eb551411721cf21bae52bb (patch)
treeb6683030ee351cd964ec51e63d5e4ecb8f48608e /runtime/lua/vim/lsp/buf.lua
parent3c51058d7611ef235a23ae77f994403480237700 (diff)
downloadrneovim-c8d7d65679f832b406eb551411721cf21bae52bb.tar.gz
rneovim-c8d7d65679f832b406eb551411721cf21bae52bb.tar.bz2
rneovim-c8d7d65679f832b406eb551411721cf21bae52bb.zip
fix(lsp): use correct method for prepareTypehierarchy
Regression from #30902
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r--runtime/lua/vim/lsp/buf.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index 1858095918..e0c03edf1e 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -663,8 +663,9 @@ end
---@param kind "subtypes"|"supertypes"
function M.typehierarchy(kind)
local method = kind == 'subtypes' and ms.typeHierarchy_subtypes or ms.typeHierarchy_supertypes
+ local pmethod = ms.textDocument_prepareTypeHierarchy
local bufnr = api.nvim_get_current_buf()
- local clients = lsp.get_clients({ bufnr = bufnr, method = method })
+ local clients = lsp.get_clients({ bufnr = bufnr, method = pmethod })
if not next(clients) then
vim.notify(lsp._unsupported_method(method), vim.log.levels.WARN)
return
@@ -701,7 +702,7 @@ function M.typehierarchy(kind)
for _, client in ipairs(clients) do
local params = util.make_position_params(win, client.offset_encoding)
- client.request(method, params, function(err, result, ctx)
+ client.request(pmethod, params, function(err, result, ctx)
--- @cast result lsp.TypeHierarchyItem[]?
if err then
vim.notify(err.message, vim.log.levels.WARN)