From 2836ea2ac40bd54ec1b00ffcd5927cdb4b7724d3 Mon Sep 17 00:00:00 2001 From: Vitalii Solodilov Date: Thu, 27 Apr 2023 17:30:15 +0300 Subject: feat: add a config option to exclude declaration from LSP references (#6886) * feat: added the config option to exclude declaration from reference query Fixes: #5344 * fix: review * fix: review--- helix-term/src/commands/lsp.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'helix-term/src') diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index b5d1d337..0ad6fb7e 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -1078,13 +1078,19 @@ pub fn goto_implementation(cx: &mut Context) { } pub fn goto_reference(cx: &mut Context) { + let config = cx.editor.config(); let (view, doc) = current!(cx.editor); let language_server = language_server!(cx.editor, doc); let offset_encoding = language_server.offset_encoding(); let pos = doc.position(view.id, offset_encoding); - let future = match language_server.goto_reference(doc.identifier(), pos, None) { + let future = match language_server.goto_reference( + doc.identifier(), + pos, + config.lsp.goto_reference_include_declaration, + None, + ) { Some(future) => future, None => { cx.editor -- cgit v1.2.3-70-g09d2