From bf0122ec08ac52f6b42414dc8ede04251b796053 Mon Sep 17 00:00:00 2001 From: D4yvid Date: Wed, 26 Oct 2022 21:14:57 -0300 Subject: [PATCH] Removed "Print()" method used for debugging --- autoload/lsp/codeaction.vim | 4 ---- autoload/lsp/options.vim | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/autoload/lsp/codeaction.vim b/autoload/lsp/codeaction.vim index 578603f..63d1cae 100644 --- a/autoload/lsp/codeaction.vim +++ b/autoload/lsp/codeaction.vim @@ -23,10 +23,6 @@ export def HandleCodeAction(lspserver: dict, selAction: dict) endif enddef -def Print(a: any) - echo string(a) -enddef - export def ApplyCodeAction(lspserver: dict, actions: list>): void if actions->empty() # no action can be performed diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index 5308e83..a067a54 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -36,10 +36,49 @@ export var lspOptions: dict = { showDiagInPopup: true, # Don't print message when a configured language server is missing. ignoreMissingServer: false, + # Customize all LSP kinds from the completion popup + lspKinds: {}, # Use a floating menu to show the code action menu instead of asking for input usePopupInCodeAction: false } +export var defaultLspKinds: dict = { + text: 't', + method: 'm', + function: 'f', + constructor: 'C', + field: 'F', + variable: 'v', + class: 'c', + interface: 'i', + module: 'M', + property: 'p', + unit: 'u', + value: 'V', + enum: 'e', + keyword: 'k', + snippet: 'S', + color: 'C', + file: 'f', + reference: 'r', + folder: 'F', + enumMember: 'E', + constant: 'd', + struct: 's', + event: 'E', + operator: 'o', + typeParameter: 'T' +} + +# get a custom LSP kind to use in the completion +export def GetLspKind(name: string): string + if has_key(lspOptions.lspKinds, name) + return lspOptions.lspKinds[name] + endif + + return defaultLspKinds[name] +enddef + # set LSP options from user provided options export def OptionsSet(opts: dict) for key in opts->keys() -- 2.48.1