clojure-lsp / clojure-lsp-intellij

Intellij Plugin for Clojure & ClojureScript development via Language Server (LSP) made in Clojure
https://clojure-lsp.io
MIT License
76 stars 5 forks source link

Improve naviagation between defrecord implementations and references #39

Closed velios closed 3 months ago

velios commented 3 months ago

After huge improvement #31 I think it is appropriate to ask the following improvements.

  1. Is it is possible for commands Find references and Find implementations move forward to reference/implementation if only one option found. Without show usages dialog.
  2. Also interesting is it possible to make Go To Implementations or References command to toggle between implementations and references. Like it already done in IDEA for Go to Declaration and Usages. With suggestion (1) it can dramatically increase navigation speed.
ericdallo commented 3 months ago

Is it is possible for commands Find references and Find implementations move forward to reference/implementation if only one option found. Without show usages dialog.

yes, this is how other editors do with clojure-lsp, we can do that as well.

Also interesting is it possible to make Go To Implementations or References command to toggle between implementations and references. Like it already done in IDEA for Go to Declaration and Usages. With suggestion (1) it can dramatically increase navigation speed.

Could you elaborate a little bit better? Ctrl + click already does that right?

velios commented 3 months ago

Could you elaborate a little bit better? Ctrl + click already does that right?

In my case there is no option to use only you plugin and I use it with cursive. Not a lot of trouble actually. I just remap keymap as shown on screenshot

image

But it be cool if we have another option in keymap like Go To Implementations or References which works as i described above. Move directly to Implementaion/Reference without show dialog if only one option found. Also if i already or reference(or maybe it't easy to do with logic if no reference found, try found implementation) and move to it and vica versa.

Just ilustrate. Now if only one option shown dialog like this

image

Anyway for now not really valuable click go to implementation if i already on implementation

image
ericdallo commented 3 months ago

@velios Just released 2.2.0 improving support and fixing 1, but I don't think it makes sense for 2. to alternate between references/implementations or definition since those commands have their own purpose, no other editor does that and I think it's against the goal of those commands.

velios commented 3 months ago

@ericdallo thank you a lot. Works pretty well. Yes, I really haven’t seen this in other editors. But use already existing Go to Declaration and Usages feels awesome. I would be glad if it was possible to move between implementation and reference of defprotocol using the same command Go to Declaration and Usages. It will be super convinient.

What about my proposal, in my head Go To Implementations or References pretty convinience thing. Let's imagine my cursor already on implementation, so what benefit to me see no implementation found popup. Of course it is not, i just confused in my two different shortcuts when exploring my code and jump back and forward between implementations and references