From 90fe4bfc5f7364bb4443015d5f7fe14f482d9d31 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Thu, 26 Aug 2021 22:43:22 -0700 Subject: [PATCH] Add top-level and popup menu for LSP in GUI --- plugin/lsp.vim | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 4b6bb74..572e201 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -57,4 +57,48 @@ command! -nargs=0 -bar LspWorkspaceListFolders call lsp#listWorkspaceFolders() command! -nargs=1 -bar -complete=dir LspWorkspaceAddFolder call lsp#addWorkspaceFolder() command! -nargs=1 -bar -complete=dir LspWorkspaceRemoveFolder call lsp#removeWorkspaceFolder() +" Add the GUI menu entries +if has('gui_running') + anoremenu L&sp.Goto.Definition :call lsp#gotoDefinition() + anoremenu L&sp.Goto.Declaration :call lsp#gotoDeclaration() + anoremenu L&sp.Goto.Implementation :call lsp#gotoImplementation() + anoremenu L&sp.Goto.TypeDef :call lsp#gotoTypedef() + + anoremenu L&sp.Show\ Signature :call lsp#showSignature() + anoremenu L&sp.Show\ References :call lsp#showReferences() + anoremenu L&sp.Show\ Detail :call lsp#hover() + anoremenu L&sp.Outline :call lsp#outline() + + anoremenu L&sp.Symbol\ Search :call lsp#symbolSearch('') + anoremenu L&sp.CalledBy :call lsp#incomingCalls() + anoremenu L&sp.Calling :call lsp#outgoingCalls() + anoremenu L&sp.Rename :call lsp#rename() + anoremenu L&sp.Code\ Action :call lsp#codeAction() + + anoremenu L&sp.Highlight\ Symbol :call lsp#docHighlight() + anoremenu L&sp.Highlight\ Clear :call lsp#docHighlightClear() + + " Diagnostics + anoremenu L&sp.Diagnostics.Current :call lsp#showCurrentDiag + anoremenu L&sp.Diagnostics.Show\ All :call lsp#showDiagnostics() + anoremenu L&sp.Diagnostics.First :call lsp#jumpToDiag('first') + anoremenu L&sp.Diagnostics.Next :call lsp#jumpToDiag('next') + anoremenu L&sp.Diagnostics.Prev :call lsp#jumpToDiag('prev') + + if &mousemodel =~ 'popup' + anoremenu PopUp.L&sp.Go\ to\ Definition + \ :call lsp#gotoDefinition() + anoremenu PopUp.L&sp.Go\ to\ Declaration + \ :call lsp#gotoDeclaration() + anoremenu Popup.L&sp.Find\ All\ References + \ :call lsp#showReferences() + anoremenu PopUp.L&sp.Show\ Detail + \ :call lsp#hover() + anoremenu PopUp.L&sp.Highlight\ Symbol + \ :call lsp#docHighlight() + anoremenu PopUp.L&sp.Highlight\ Clear + \ :call lsp#docHighlightClear() + endif +endif + " vim: shiftwidth=2 softtabstop=2 -- 2.48.1