diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2023-06-30 11:33:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-30 11:33:28 +0200 |
commit | 37079fca58f396fd866dc7b7d87a0100c17ee760 (patch) | |
tree | 876851052cf0eecbb5e05c4d7ad2abd5ee887e57 /runtime/lua/vim/lsp/handlers.lua | |
parent | d55d7646c129a9afe1da3a61813bb365d178c421 (diff) | |
download | rneovim-37079fca58f396fd866dc7b7d87a0100c17ee760.tar.gz rneovim-37079fca58f396fd866dc7b7d87a0100c17ee760.tar.bz2 rneovim-37079fca58f396fd866dc7b7d87a0100c17ee760.zip |
feat(lsp): move inlay_hint() to vim.lsp (#24130)
Allows to keep more functions hidden and gives a path forward for
further inlay_hint related functions - like applying textEdits.
See https://github.com/neovim/neovim/pull/23984#pullrequestreview-1486624668
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 284e3ef2d0..625a2ed282 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -220,7 +220,7 @@ M['textDocument/codeLens'] = function(...) end M['textDocument/inlayHint'] = function(...) - return require('vim.lsp._inlay_hint').on_inlayhint(...) + return require('vim.lsp.inlay_hint').on_inlayhint(...) end --see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references @@ -617,22 +617,8 @@ M['window/showDocument'] = function(_, result, ctx, _) end ---@see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_inlayHint_refresh -M['workspace/inlayHint/refresh'] = function(err, _, ctx) - local inlay_hint = require('vim.lsp._inlay_hint') - if err then - return vim.NIL - end - - for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do - for _, winid in ipairs(api.nvim_list_wins()) do - if api.nvim_win_get_buf(winid) == bufnr then - inlay_hint.refresh({ bufnr = bufnr }) - break - end - end - end - - return vim.NIL +M['workspace/inlayHint/refresh'] = function(err, result, ctx, config) + return require('vim.lsp.inlay_hint').on_refresh(err, result, ctx, config) end -- Add boilerplate error validation and logging for all of these. |