From: shane.xb.qian <shane.qian@foxmail.com>
Date: Wed, 12 Apr 2023 03:23:32 +0000 (+0800)
Subject: fix: kind typo and tidy
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=43cd845d636ac21ffec84112e41db22c1764272f;p=vim-lsp.git

fix: kind typo and tidy

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
---

diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim
index 09153d4..dbf5b7e 100644
--- a/autoload/lsp/completion.vim
+++ b/autoload/lsp/completion.vim
@@ -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
diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim
index 4c99a2a..1073007 100644
--- a/autoload/lsp/symbol.vim
+++ b/autoload/lsp/symbol.vim
@@ -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
diff --git a/doc/lsp.txt b/doc/lsp.txt
index b97ae89..291936e 100644
--- a/doc/lsp.txt
+++ b/doc/lsp.txt
@@ -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