]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
fix: kind typo and tidy
authorshane.xb.qian <shane.qian@foxmail.com>
Wed, 12 Apr 2023 03:23:32 +0000 (11:23 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Wed, 12 Apr 2023 03:23:32 +0000 (11:23 +0800)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/completion.vim
autoload/lsp/symbol.vim
doc/lsp.txt

index 09153d4ea9df813325cc7530e5742014ea19cc15..dbf5b7e50d84906406549aefec560b433e506e73 100644 (file)
@@ -11,31 +11,31 @@ import './textedit.vim'
 var ftypeOmniCtrlMap: dict<bool> = {}
 
 var defaultKinds: 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',
-  'Contant': 'd',
-  'Struct': 's',
-  'Event': 'E',
-  'Operator': 'o',
-  'TypeParameter': 'T'
+  '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'
 }
 
 # Returns true if omni-completion is enabled for filetype 'ftype'.
@@ -51,32 +51,33 @@ enddef
 
 # Map LSP complete item kind to a character
 def LspCompleteItemKindChar(kind: number): string
-  var kindMap: list<string> = ['',
-       'Text',
-       'Method',
-       'Function',
-       'Constructor',
-       'Field',
-       'Variable',
-       'Class',
-       'Interface',
-       'Module',
-       'Property',
-       'Unit',
-       'Value',
-       'Enum',
-       'Keyword',
-       'Snippet',
-       'Color',
-       'File',
-       'Reference',
-       'Folder',
-       'EnumMember',
-       'Contant',
-       'Struct',
-       'Event',
-       'Operator',
-       'TypeParameter'
+  var kindMap: list<string> = [
+    '',
+    'Text',
+    'Method',
+    'Function',
+    'Constructor',
+    'Field',
+    'Variable',
+    'Class',
+    'Interface',
+    'Module',
+    'Property',
+    'Unit',
+    'Value',
+    'Enum',
+    'Keyword',
+    'Snippet',
+    'Color',
+    'File',
+    'Reference',
+    'Folder',
+    'EnumMember',
+    'Constant',
+    'Struct',
+    'Event',
+    'Operator',
+    'TypeParameter'
   ]
 
   if kind > 25
index 4c99a2aa1996d9554efe1a273cc4409b8484b3c0..107300733d719f179ed640ced04f1f930890edbc 100644 (file)
@@ -216,11 +216,35 @@ enddef
 
 # map the LSP symbol kind number to string
 export def SymbolKindToName(symkind: number): string
-  var symbolMap: list<string> = ['', 'File', 'Module', 'Namespace', 'Package',
-       'Class', 'Method', 'Property', 'Field', 'Constructor', 'Enum',
-       'Interface', 'Function', 'Variable', 'Constant', 'String', 'Number',
-       'Boolean', 'Array', 'Object', 'Key', 'Null', 'EnumMember', 'Struct',
-       'Event', 'Operator', 'TypeParameter']
+  var symbolMap: list<string> = [
+    '',
+    'File',
+    'Module',
+    'Namespace',
+    'Package',
+    'Class',
+    'Method',
+    'Property',
+    'Field',
+    'Constructor',
+    'Enum',
+    'Interface',
+    'Function',
+    'Variable',
+    'Constant',
+    'String',
+    'Number',
+    'Boolean',
+    'Array',
+    'Object',
+    'Key',
+    'Null',
+    'EnumMember',
+    'Struct',
+    'Event',
+    'Operator',
+    'TypeParameter'
+  ]
   if symkind > 26
     return ''
   endif
index b97ae890e8105141c20784195f3c9e826179568a..291936ea1d590c907a6711a1eccad152aaf96bc3 100644 (file)
@@ -1273,7 +1273,7 @@ option |lsp-opt-completionKinds| . There is a table with all default LSP kinds:
  Reference              | r
  Folder                 | F
  EnumMember             | E
- Contant                | d
+ Constant               | d
  Struct                 | s
  Event                  | E
  Operator               | o