]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Removed "Print()" method used for debugging
authorD4yvid <kkd4yv1d@gmail.com>
Thu, 27 Oct 2022 00:14:57 +0000 (21:14 -0300)
committerD4yvid <kkd4yv1d@gmail.com>
Thu, 27 Oct 2022 00:14:57 +0000 (21:14 -0300)
autoload/lsp/codeaction.vim
autoload/lsp/options.vim

index 578603f858652eb04aa6112c6f6eb6bf2b47874d..63d1cae72a50f8e18e60db7b15d4af8deb441e41 100644 (file)
@@ -23,10 +23,6 @@ export def HandleCodeAction(lspserver: dict<any>, selAction: dict<any>)
   endif
 enddef
 
-def Print(a: any)
-  echo string(a)
-enddef
-
 export def ApplyCodeAction(lspserver: dict<any>, actions: list<dict<any>>): void
   if actions->empty()
     # no action can be performed
index 5308e83c0482d7754f34c2bcf62da0dd1a193599..a067a543ef517de2e9eb5d4bfcd63b3f19a54655 100644 (file)
@@ -36,10 +36,49 @@ export var lspOptions: dict<any> = {
   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<string> = {
+  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<any>)
   for key in opts->keys()