nvim: lsp: Move the completion item symbols from completion-nvim to LSP
This commit is contained in:
parent
5c2d83a833
commit
6ef47458e2
2 changed files with 30 additions and 17 deletions
|
@ -1,7 +1,8 @@
|
||||||
local nvim_lsp = require('lspconfig')
|
local nvim_lsp = require('lspconfig')
|
||||||
local completion = require('completion')
|
local completion = require('completion')
|
||||||
local lsp_status = require('lsp-status')
|
local lsp_status = require('lsp-status')
|
||||||
local lsp_fuzzy = require('lspfuzzy')
|
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/
|
-- Taken from https://www.reddit.com/r/neovim/comments/gyb077/nvimlsp_peek_defination_javascript_ttserver/
|
||||||
function preview_location(location, context, before_context)
|
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', ']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', '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)
|
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
|
end
|
||||||
|
|
||||||
local servers = { 'hls', 'rust_analyzer' }
|
local servers = { 'hls', 'rust_analyzer' }
|
||||||
|
|
|
@ -5,22 +5,6 @@ vim.g.completion_auto_change_source = 1
|
||||||
vim.g.completion_trigger_on_delete = 1
|
vim.g.completion_trigger_on_delete = 1
|
||||||
vim.g.completion_matching_ignore_case = 0
|
vim.g.completion_matching_ignore_case = 0
|
||||||
vim.g.completion_matching_strategy_list = { 'exact', 'substring' }
|
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 = {
|
vim.g.completion_chain_complete_list = {
|
||||||
c = {
|
c = {
|
||||||
|
|
Loading…
Reference in a new issue