From: shane.xb.qian Date: Sat, 10 Jun 2023 18:19:35 +0000 (+0800) Subject: fix: 'super' is a keyword cannot use X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6823c78a570220774dc304f9bbca817991a00c53;p=vim-lsp.git fix: 'super' is a keyword cannot use --- diff --git a/autoload/lsp/typehierarchy.vim b/autoload/lsp/typehierarchy.vim index 67c4965..0464ec8 100644 --- a/autoload/lsp/typehierarchy.vim +++ b/autoload/lsp/typehierarchy.vim @@ -10,11 +10,11 @@ import './symbol.vim' # super/sub type hierarchy. # # Returns the line number where the next type name should be added. -def TypeTreeGenerate(super: bool, typeHier: dict, pfx_arg: string, +def TypeTreeGenerate(isSuper: bool, typeHier: dict, pfx_arg: string, typeTree: list, typeUriMap: list>) var itemHasChildren = false - if super + if isSuper if typeHier->has_key('parents') && !typeHier.parents->empty() itemHasChildren = true endif @@ -47,10 +47,10 @@ def TypeTreeGenerate(super: bool, typeHier: dict, pfx_arg: string, endif var items: list> - items = super ? typeHier.parents : typeHier.children + items = isSuper ? typeHier.parents : typeHier.children for item in items - TypeTreeGenerate(super, item, $'{pfx_arg}| ', typeTree, typeUriMap) + TypeTreeGenerate(isSuper, item, $'{pfx_arg}| ', typeTree, typeUriMap) endfor enddef @@ -136,7 +136,7 @@ def TypeHierPopupCallback(lspserver: dict, typeUriMap: list>, enddef # Show the super or sub type hierarchy items 'types' as a tree in a popup window -export def ShowTypeHierarchy(lspserver: dict, super: bool, types: dict) +export def ShowTypeHierarchy(lspserver: dict, isSuper: bool, types: dict) if lspserver.typeHierPopup->winbufnr() != -1 # If the type hierarchy popup window is already present, close it. @@ -147,12 +147,12 @@ export def ShowTypeHierarchy(lspserver: dict, super: bool, types: dict var typeUriMap: list> # Generate a tree of the type hierarchy items - TypeTreeGenerate(super, types, '', typeTree, typeUriMap) + TypeTreeGenerate(isSuper, types, '', typeTree, typeUriMap) # Display a popup window with the type hierarchy tree and a popup window for # the file. var popupAttrs = { - title: $'{super ? "Super" : "Sub"}Type Hierarchy', + title: $'{isSuper ? "Super" : "Sub"}Type Hierarchy', wrap: 0, pos: 'topleft', line: 'cursor+1',