nvim: lsp: Move the completion item symbols from completion-nvim to LSP

This commit is contained in:
Sanchayan Maity 2021-02-02 16:14:15 +05:30
parent 5c2d83a833
commit 6ef47458e2
2 changed files with 30 additions and 17 deletions

View file

@ -2,6 +2,7 @@ local nvim_lsp = require('lspconfig')
local completion = require('completion')
local lsp_status = require('lsp-status')
local lsp_fuzzy = require('lspfuzzy')
local protocol = require('vim.lsp.protocol')
-- Taken from https://www.reddit.com/r/neovim/comments/gyb077/nvimlsp_peek_defination_javascript_ttserver/
function preview_location(location, context, before_context)
@ -73,6 +74,34 @@ local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']D', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'do', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
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
local servers = { 'hls', 'rust_analyzer' }

View file

@ -5,22 +5,6 @@ vim.g.completion_auto_change_source = 1
vim.g.completion_trigger_on_delete = 1
vim.g.completion_matching_ignore_case = 0
vim.g.completion_matching_strategy_list = { 'exact', 'substring' }
vim.g.completion_customize_lsp_label = {
Function = " [function]",
Method = " [method]",
Reference = " [reference]",
Enum = " [enum]",
Field = "ﰠ [field]",
Keyword = " [key]",
Variable = " [variable]",
Folder = " [folder]",
Snippet = " [snippet]",
Operator = " [operator]",
Module = " [module]",
Text = "ﮜ[text]",
Class = " [class]",
Interface = " [interface]"
}
vim.g.completion_chain_complete_list = {
c = {