From: D4yvid Date: Thu, 27 Oct 2022 00:18:32 +0000 (-0300) Subject: Created a option to use popup menu in code action X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bdadeda3f0ad3ef52828d9b949bb93189f433157;p=vim-lsp.git Created a option to use popup menu in code action --- diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index a067a54..5308e83 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -36,49 +36,10 @@ 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() diff --git a/doc/lsp.txt b/doc/lsp.txt index 78874bc..d885cc0 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -267,6 +267,10 @@ showDiagInPopup When using the |:LspDiagCurrent| command to display popup window to display the message instead of echoing in the status area. By default this is set to true. +usePopupInCodeAction When using the |:LspCodeAction| command to display the + code action for the current line, use a popup menu + instead of echoing. + By default this is set to false. ignoreMissingServer Do not print a missing language server executable. By default this is set to false.