From be675ffca2e7bdea58b30c6fd14d719eb9d64304 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Tue, 20 Dec 2022 18:33:51 +0100 Subject: [PATCH] Add GUI menus (#1402) * Add GUI menus This change adds some basic GUI menu and right-click popup. * Update lsp.vim --- plugin/lsp.vim | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/plugin/lsp.vim b/plugin/lsp.vim index f14e2124..cb079a38 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -200,3 +200,34 @@ nnoremap (lsp-status) :echo lsp#get_server_status() nnoremap (lsp-next-reference) :call lsp#internal#document_highlight#jump(+1) nnoremap (lsp-previous-reference) :call lsp#internal#document_highlight#jump(-1) nnoremap (lsp-signature-help) :call lsp#ui#vim#signature_help#get_signature_help_under_cursor() + +if has('gui_running') + anoremenu L&sp.Goto.Definition :LspDefinition + anoremenu L&sp.Goto.Declaration :LspDeclaration + anoremenu L&sp.Goto.Implementation :LspImplementation + anoremenu L&sp.Goto.TypeDef :LspTypeDefinition + + anoremenu L&sp.Show\ Signature :LspShowSignature + anoremenu L&sp.Show\ References :LspReferences + anoremenu L&sp.Show\ Detail :LspHover + + anoremenu L&sp.Symbol\ Search :LspDocumentSymbolSearch + anoremenu L&sp.Outgoing\ Calls :LspCallHierarchyOutgoing + anoremenu L&sp.Incoming\ Calls :LspCallHierarchyIncoming + anoremenu L&sp.Rename :LspRename + anoremenu L&sp.Code\ Action :LspCodeAction + + anoremenu L&sp.Diagnostics.Next :LspNextDiagnostic + anoremenu L&sp.Diagnostics.Prev :LspPrevDiagnostic + + if &mousemodel =~? 'popup' + anoremenu PopUp.L&sp.Go\ to\ Definition + \ :LspDefinition + anoremenu PopUp.L&sp.Go\ to\ Declaration + \ :LspDeclaration + anoremenu PopUp.L&sp.Find\ All\ References + \ :LspReferences + anoremenu PopUp.L&sp.Show\ Detail + \ :LspHover + endif +endif