Skip to content

Commit b3edf86

Browse files
authored
Definition is not declaration (#3655) (#4613)
1 parent c41769e commit b3edf86

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lsp-mode.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,12 @@ If this is set to nil, `eldoc' will show only the symbol information."
547547
:type 'boolean
548548
:group 'lsp-mode)
549549

550-
(defcustom lsp-references-exclude-definition nil
550+
(define-obsolete-variable-alias
551+
'lsp-references-exclude-definition
552+
'lsp-references-exclude-declaration
553+
"9.0.1")
554+
555+
(defcustom lsp-references-exclude-declaration nil
551556
"If non-nil, exclude declarations when finding references."
552557
:type 'boolean
553558
:group 'lsp-mode)
@@ -6472,7 +6477,7 @@ perform the request synchronously."
64726477
(goto-char (cl-rest (or (assoc identifier lsp--symbols-cache)
64736478
(user-error "Unable to find symbol %s" identifier)))))
64746479
(lsp--locations-to-xref-items (lsp-request "textDocument/references"
6475-
(lsp--make-reference-params nil lsp-references-exclude-definition)))))
6480+
(lsp--make-reference-params nil lsp-references-exclude-declaration)))))
64766481

64776482
(cl-defmethod xref-backend-apropos ((_backend (eql xref-lsp)) pattern)
64786483
(seq-map #'lsp--symbol-information-to-xref
@@ -6653,7 +6658,7 @@ REFERENCES? t when METHOD returns references."
66536658
"Find references of the symbol under point."
66546659
(interactive "P")
66556660
(lsp-find-locations "textDocument/references"
6656-
(list :context `(:includeDeclaration ,(lsp-json-bool (not (or exclude-declaration lsp-references-exclude-definition)))))
6661+
(list :context `(:includeDeclaration ,(lsp-json-bool (not (or exclude-declaration lsp-references-exclude-declaration)))))
66576662
:display-action display-action
66586663
:references? t))
66596664

0 commit comments

Comments
 (0)