nvim: lsp: Enable text for LSP protocol completion item kind

This commit is contained in:
Sanchayan Maity 2021-12-16 18:52:53 +05:30
parent 2a8dd6343a
commit b7762f552d

View file

@ -29,6 +29,34 @@ function PeekDefinition()
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback) return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
end end
protocol.CompletionItemKind = {
' Text' ;
' Method' ;
' Function' ;
'全Constructor' ;
' Field' ;
' Variable' ;
' Class' ;
' Interface' ;
' Module' ;
' Property' ;
' Unit' ;
' Value' ;
'螺Enum' ;
' Keyword' ;
' Snippet' ;
' Color' ;
' File' ;
' Reference' ;
' Folder' ;
' Enunm' ;
' Constant' ;
' Struct' ;
' Event' ;
'璉Operator' ;
' TypeParameter';
}
local ts_utils_setup = function(client, bufnr, opts) local ts_utils_setup = function(client, bufnr, opts)
if client.name == 'tsserver' then if client.name == 'tsserver' then
-- Disable tsserver formatting, we want formatting via prettier -- Disable tsserver formatting, we want formatting via prettier
@ -144,34 +172,6 @@ local on_attach = function(client, bufnr)
vim.api.nvim_command [[autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()]] vim.api.nvim_command [[autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()]]
vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]] vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]]
end end
protocol.CompletionItemKind = {
''; -- text
''; -- method
''; -- function
''; -- ctor
''; -- field
''; -- variable
''; -- class
''; -- interface
''; -- module
''; -- property
''; -- unit
''; -- value
''; -- enum
''; -- keyword
''; -- snippet
''; -- color
''; -- file
''; -- reference
''; -- folder
''; -- enum member
''; -- constant
''; -- struct
''; -- event
''; -- operator
''; -- type parameter
}
end end
local on_init = function(client) local on_init = function(client)