From 43cd845d636ac21ffec84112e41db22c1764272f Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Wed, 12 Apr 2023 11:23:32 +0800 Subject: [PATCH] fix: kind typo and tidy Signed-off-by: shane.xb.qian --- autoload/lsp/completion.vim | 103 ++++++++++++++++++------------------ autoload/lsp/symbol.vim | 34 ++++++++++-- doc/lsp.txt | 2 +- 3 files changed, 82 insertions(+), 57 deletions(-) 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 = {} var defaultKinds: 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', - '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 = ['', - '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 = [ + '', + '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 = ['', '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 = [ + '', + '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 -- 2.48.1