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.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.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 1e5ce8fa10..ca4851f8d7 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -2474,6 +2474,13 @@ function lsp.with(handler, override_config) end end +--- Enable/disable/toggle inlay hints for a buffer +---@param bufnr (integer) Buffer handle, or 0 for current +---@param enable (boolean|nil) true/false to enable/disable, nil to toggle +function lsp.inlay_hint(bufnr, enable) + return require('vim.lsp.inlay_hint')(bufnr, enable) +end + --- Helper function to use when implementing a handler. --- This will check that all of the keys in the user configuration --- are valid keys and make sense to include for this handler. |