aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorVitalii Solodilov2023-04-27 14:30:15 +0000
committerGitHub2023-04-27 14:30:15 +0000
commit2836ea2ac40bd54ec1b00ffcd5927cdb4b7724d3 (patch)
tree0fdc72cc6ac4f82f67b160f0b3cbabe4cbdb862d /helix-term
parent222be0f1e769177241eb2d8d8dfb0de42e450820 (diff)
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
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands/lsp.rs8
1 files changed, 7 insertions, 1 deletions
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