Skip to content

Commit

Permalink
Reapply "Fix code lens references not working when more than a projec…
Browse files Browse the repository at this point in the history
…t is opened."

This reverts commit 3b93794.
  • Loading branch information
ericdallo committed Feb 18, 2025
1 parent 3b93794 commit 2ae8f81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Bump clj4intellij to 0.6.3.
- Improve server installation fixing concurrency bugs + using lsp4ij install API.
- Fix code lens references not working when more than a project is opened. #67

## 3.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
(.registerAction manager id action)
action)))

(defn ^:private code-lens-references-performed [^Project project ^LSPCommand command ^AnActionEvent event]
(let [uri (.getAsString ^JsonPrimitive (.getArgumentAt command 0))
(defn ^:private code-lens-references-performed [^LSPCommand command ^AnActionEvent event]
(let [project (.getProject event)
uri (.getAsString ^JsonPrimitive (.getArgumentAt command 0))
line (dec (.getAsInt ^JsonPrimitive (.getArgumentAt command 1)))
character (dec (.getAsInt ^JsonPrimitive (.getArgumentAt command 2)))
references (lsp-client/references uri line character project)
Expand All @@ -118,7 +119,7 @@
:use-shortcut-of use-shortcut-of
:on-performed (partial on-action-performed name text project)))
(register-command! :id "code-lens-references"
:on-performed (partial code-lens-references-performed project))
:on-performed #'code-lens-references-performed)
(action/register-group! :id "ClojureLSP.Refactors"
:popup true
:text "Clojure refactors"
Expand Down

0 comments on commit 2ae8f81

Please sign in to comment.