nvim: lsp: Inlay hints API has changed
This commit is contained in:
parent
7810c43679
commit
020d9ed8a6
1 changed files with 8 additions and 3 deletions
|
@ -15,7 +15,12 @@ local peek_definition = function()
|
|||
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
|
||||
end
|
||||
|
||||
_G.PeekDefinition = peek_definition
|
||||
local inlay_hint_toggle = function()
|
||||
vim.lsp.inlay_hint.enable(nil, not vim.lsp.inlay_hint.is_enabled())
|
||||
end
|
||||
|
||||
_G.InlayHintToggle = inlay_hint_toggle
|
||||
_G.PeekDefinition = peek_definition
|
||||
|
||||
protocol.CompletionItemKind = {
|
||||
' Text' ;
|
||||
|
@ -58,7 +63,7 @@ local lsp_key_mappings = {
|
|||
{ "workspace/symbol" , 'n', '1gD' , '<cmd>lua vim.lsp.buf.workspace_symbol()<CR>' },
|
||||
{ "textDocument/signatureHelp" , 'n', '<Leader>S', '<cmd>lua vim.lsp.buf.signature_help()<CR>' },
|
||||
{ "textDocument/rename" , 'n', 'gR' , '<cmd>lua vim.lsp.buf.rename()<CR>' },
|
||||
{ "textDocument/inlayHint" , 'n', 'gi' , '<cmd>lua vim.lsp.inlay_hint(0, nil)<CR>' },
|
||||
{ "textDocument/inlayHint" , 'n', 'gi' , '<cmd>lua InlayHintToggle()<CR>' },
|
||||
|
||||
{ "textDocument/rangeFormatting", 'x', 'gq', '<cmd>lua vim.lsp.buf.format({async=true})<CR>' },
|
||||
{ "textDocument/formatting" , 'n', 'gq', '<cmd>lua vim.lsp.buf.format({async=true})<CR>' },
|
||||
|
@ -236,7 +241,7 @@ local on_attach = function(client, bufnr)
|
|||
end
|
||||
|
||||
if client.supports_method('textDocument/inlayHint') then
|
||||
vim.lsp.inlay_hint(bufnr, false)
|
||||
vim.lsp.inlay_hint.enable(bufnr, false)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue