From: D4yvid Date: Thu, 27 Oct 2022 00:14:57 +0000 (-0300) Subject: Removed "Print()" method used for debugging X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bf0122ec08ac52f6b42414dc8ede04251b796053;p=vim-lsp.git Removed "Print()" method used for debugging --- 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()