|
|
|
@ -53,29 +53,18 @@ protocol.CompletionItemKind = {
|
|
|
|
|
local lsp_augroup_id = vim.api.nvim_create_augroup("LSP", { clear = true })
|
|
|
|
|
|
|
|
|
|
local lsp_key_mappings = {
|
|
|
|
|
{ "textDocument/definition" , 'n', 'pd' , '<cmd>lua PeekDefinition()<CR>' },
|
|
|
|
|
{ "textDocument/definition" , 'n', 'gd' , '<cmd>lua vim.lsp.buf.definition()<CR>' },
|
|
|
|
|
--{ "textDocument/declaration" , 'n', 'gD' , '<cmd>lua vim.lsp.buf.declaration()<CR>' },
|
|
|
|
|
{ "textDocument/typeDefinition" , 'n', '<C-k>' , '<cmd>lua vim.lsp.buf.type_definition()<CR>' },
|
|
|
|
|
{ "textDocument/implementation" , 'n', 'gD' , '<cmd>lua vim.lsp.buf.implementation()<CR>' },
|
|
|
|
|
{ "textDocument/documentSymbol" , 'n', '1gd' , '<cmd>lua vim.lsp.buf.document_symbol()<CR>' },
|
|
|
|
|
{ "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 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>' },
|
|
|
|
|
|
|
|
|
|
{ "textDocument/codeAction", 'n', 'ga' , '<cmd>lua vim.lsp.buf.code_action()<CR>' },
|
|
|
|
|
{ "textDocument/codeAction", 'v', 'ga' , '<cmd>lua vim.lsp.buf.code_action()<CR>' },
|
|
|
|
|
{ "textDocument/codeAction", 'n', '<Leader>r', '<cmd>lua vim.lsp.buf.code_action{only = \'refactor\' }<CR>' },
|
|
|
|
|
{ "textDocument/codeAction", 'v', '<Leader>r', '<cmd>lua vim.lsp.buf.code_action{only = \'refactor\' }<CR>' },
|
|
|
|
|
{ "textDocument/definition" , 'n', 'pd' , '<cmd>lua PeekDefinition()<CR>' },
|
|
|
|
|
{ "textDocument/inlayHint" , 'n', 'gi' , '<cmd>lua InlayHintToggle()<CR>' },
|
|
|
|
|
{ "textDocument/definition" , 'n', 'gd' , '<cmd>lua vim.lsp.buf.definition()<CR>' },
|
|
|
|
|
--{ "textDocument/declaration" , 'n', 'gD' , '<cmd>lua vim.lsp.buf.declaration()<CR>' },
|
|
|
|
|
{ "textDocument/typeDefinition" , 'n', '<C-k>', '<cmd>lua vim.lsp.buf.type_definition()<CR>' },
|
|
|
|
|
{ "textDocument/implementation" , 'n', 'gD' , '<cmd>lua vim.lsp.buf.implementation()<CR>' },
|
|
|
|
|
{ "textDocument/documentSymbol" , 'n', '1gd' , '<cmd>lua vim.lsp.buf.document_symbol()<CR>' },
|
|
|
|
|
{ "workspace/symbol" , 'n', '1gD' , '<cmd>lua vim.lsp.buf.workspace_symbol()<CR>' },
|
|
|
|
|
{ "textDocument/formatting" , 'n', 'gf' , '<cmd>lua vim.lsp.buf.format({async=true})<CR>' },
|
|
|
|
|
|
|
|
|
|
{ "textDocument/codeLens", 'n', '<LocalLeader>l', '<cmd>lua vim.lsp.codelens.run()<CR>' },
|
|
|
|
|
{ "textDocument/codeLens", 'n', '<LocalLeader>L', '<cmd>lua vim.lsp.codelens.clear()<CR>' },
|
|
|
|
|
|
|
|
|
|
{ "textDocument/references", 'n', 'gr', '<cmd>lua vim.lsp.buf.references({ includeDeclaration = false })<CR>'},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local CODE_ACTION_AVAILABLE = "CodeActionAvailable"
|
|
|
|
|