Skip to content

Commit 2c6a0e9

Browse files
committed
Set includeDeclaration to t by default
1 parent 4c17f92 commit 2c6a0e9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* Add setting UPDATE_EXPECT=1 when running `expect!` tests ~lsp-rust~
3939
* Add ~lsp-use-workspace-root-for-server-default-directory~.
4040
* Add [[https://github.com/artempyanykh/marksman][marksman]] support.
41+
* ~lsp-find-references~ to include declaration by default
4142
** Release 8.0.0
4243
* Add ~lsp-clients-angular-node-get-prefix-command~ to get the Angular server from another location which is still has ~/lib/node_modules~ in it.
4344
* Set ~lsp-clients-angular-language-server-command~ after the first connection to speed up subsequent connections.

lsp-mode.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,13 +4956,13 @@ type Location, LocationLink, Location[] or LocationLink[]."
49564956
((&Range :start right-start) (lsp--location-range right)))
49574957
(lsp--position-compare right-start left-start)))))
49584958

4959-
(defun lsp--make-reference-params (&optional td-position include-declaration)
4959+
(defun lsp--make-reference-params (&optional td-position exclude-declaration)
49604960
"Make a ReferenceParam object.
49614961
If TD-POSITION is non-nil, use it as TextDocumentPositionParams object instead.
4962-
If INCLUDE-DECLARATION is non-nil, request the server to include declarations."
4962+
If EXCLUDE-DECLARATION is non-nil, request the server to include declarations."
49634963
(let ((json-false :json-false))
49644964
(plist-put (or td-position (lsp--text-document-position-params))
4965-
:context `(:includeDeclaration ,(or include-declaration json-false)))))
4965+
:context `(:includeDeclaration ,(lsp-json-bool (not exclude-declaration))))))
49664966

49674967
(defun lsp--cancel-request (id)
49684968
"Cancel request with ID in all workspaces."
@@ -6152,11 +6152,11 @@ REFERENCES? t when METHOD returns references."
61526152
:display-action display-action
61536153
:references? t))
61546154

6155-
(cl-defun lsp-find-references (&optional include-declaration &key display-action)
6155+
(cl-defun lsp-find-references (&optional exclude-declaration &key display-action)
61566156
"Find references of the symbol under point."
61576157
(interactive "P")
61586158
(lsp-find-locations "textDocument/references"
6159-
(list :context `(:includeDeclaration ,(lsp-json-bool include-declaration)))
6159+
(list :context `(:includeDeclaration ,(lsp-json-bool (not exclude-declaration))))
61606160
:display-action display-action
61616161
:references? t))
61626162

0 commit comments

Comments
 (0)