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
This commit is contained in:
Mathias Fußenegger
2023-06-30 11:33:28 +02:00
committed by GitHub
parent d55d7646c1
commit 37079fca58
7 changed files with 60 additions and 53 deletions

View File

@@ -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.