Skip to content

Commit

Permalink
Set includeDeclaration to t by default
Browse files Browse the repository at this point in the history
  • Loading branch information
yyoncho committed Jul 27, 2022
1 parent 4c17f92 commit 2c6a0e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.org
Expand Up @@ -38,6 +38,7 @@
* Add setting UPDATE_EXPECT=1 when running `expect!` tests ~lsp-rust~
* Add ~lsp-use-workspace-root-for-server-default-directory~.
* Add [[https://github.com/artempyanykh/marksman][marksman]] support.
* ~lsp-find-references~ to include declaration by default
** Release 8.0.0
* 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.
* Set ~lsp-clients-angular-language-server-command~ after the first connection to speed up subsequent connections.
Expand Down
10 changes: 5 additions & 5 deletions lsp-mode.el
Expand Up @@ -4956,13 +4956,13 @@ type Location, LocationLink, Location[] or LocationLink[]."
((&Range :start right-start) (lsp--location-range right)))
(lsp--position-compare right-start left-start)))))

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

(defun lsp--cancel-request (id)
"Cancel request with ID in all workspaces."
Expand Down Expand Up @@ -6152,11 +6152,11 @@ REFERENCES? t when METHOD returns references."
:display-action display-action
:references? t))

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

Expand Down

0 comments on commit 2c6a0e9

Please sign in to comment.