zed icon indicating copy to clipboard operation
zed copied to clipboard

`cmd+click` symbol definition to find all references

Open JosephTLyons opened this issue 3 years ago • 5 comments

Being able to cmd+click on the usage of some symbol and jump to its definition has been implemented, but I would also like to be able to cmd+click on a definition to launch the Find All References action.

JosephTLyons avatar Jun 22 '22 17:06 JosephTLyons

Now this would be a hell of a feature.

mikayla-maki avatar Jun 22 '22 18:06 mikayla-maki

Now this would be a hell of a feature.

The neat thing is, Zed already supports Find All References - it opens them up into a multi-buffer, so this would just be adding the frontend changes needed to turn the definition into a link on cmd-click, which should mostly be done once https://github.com/zed-industries/zed/issues/120 lands. The code would just need to know if it is the definition of a symbol or the usage of the symbol, and then perform the correct action based on that.

JosephTLyons avatar Jun 22 '22 18:06 JosephTLyons

Yeah, I use both of them extensively right now as I'm exploring the zed code base. It's really cool to think of the 'upstream' (go to definition) and 'downstream' (find all references) behaviors here as one unified action rather than two separate ones.

mikayla-maki avatar Jun 22 '22 18:06 mikayla-maki

I tried Zed today for the first time and this is something that become muscle memory for me using VSCode, would be super helpful to have it on Zed for the intuitive migration process.

OgulcanCelik avatar Jan 28 '24 11:01 OgulcanCelik

Love the speed of Zed, but this is a must-have feature. Including showing the references in a popover instead of in a new tab.

Similarly I need project search in a sidebar (haven't figured out if that's already possible).

These are features I use every few seconds in VS Code. Will give Zed another try when these are implemented.

xixixao avatar Feb 29 '24 19:02 xixixao