autoload/lsp/lspserver.vim | 2 +- autoload/lsp/symbol.vim | 13 +++++++------ diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 48c316309b3b320590d2bd8fee41cb45b3116789..e3cb85ad23a6a959dcb563fba23d4abd339db031 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -1064,7 +1064,7 @@ util.WarnMsg('Error: No references found') return endif - symbol.ShowLocations(lspserver, reply.result, peek) + symbol.ShowLocations(lspserver, reply.result, peek, 'Symbol References') enddef # process the 'textDocument/documentHighlight' reply from the LSP server diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 964d117de9675e47230dc1db2066838f867d9e73..74fed32a58e2fab0edc1b2aa610452960921fd1b 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -303,7 +303,8 @@ enddef # Display the locations in a popup menu. Display the corresponding file in # an another popup window. -def PeekLocations(lspserver: dict, locations: list>) +def PeekLocations(lspserver: dict, locations: list>, + title: string) if lspserver.peekSymbolPopup->winbufnr() != -1 # If the symbol popup window is already present, close it. lspserver.peekSymbolPopup->popup_close() @@ -330,7 +331,7 @@ menuItems->add($'{lnum}: {text}') endfor var popupAttrs = { - title: 'References', + title: title, wrap: false, pos: 'topleft', line: 'cursor+1', @@ -348,10 +349,10 @@ lspserver.peekSymbolPopup = popup_menu(menuItems, popupAttrs) UpdatePeekFilePopup(lspserver, locations) enddef -# Display or peek locations in a loclist -export def ShowLocations(lspserver: dict, locations: list>, peekSymbol: bool) +export def ShowLocations(lspserver: dict, locations: list>, + peekSymbol: bool, title: string) if peekSymbol - PeekLocations(lspserver, locations) + PeekLocations(lspserver, locations, title) return endif @@ -375,7 +376,7 @@ text: text}) endfor var save_winid = win_getid() - setloclist(0, [], ' ', {title: 'Symbol Reference', items: qflist}) + setloclist(0, [], ' ', {title: title, items: qflist}) var mods: string = '' exe $'{mods} lopen' if !opt.lspOptions.keepFocusInReferences