sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.92k stars 107 forks source link

[Feature Request] jump to LSP symbol in a diff when possible #487

Open delabere opened 5 months ago

delabere commented 5 months ago

I am using the PR Review guide here :DiffviewOpen origin/HEAD...HEAD --imply-local

This works really well and I am able to navigate using lsp in the right panel.

What would really enhance this experience would be after going to a definition or a reference of a symbol that is in another file, that it opens up that file as a diff if the file is part of the current diff already.

For example I have a PR with two files, one.go and two.go A new function is defined in one.go and it is called in two.go.

When I open the diff on file two.go and use my lsp's go to definition on the function call, I would want one.go to open up as if I had just selected it from the file panel, with the rich diff and my cursor on the correct symbol.

Thanks!

dav1d-wright commented 4 months ago

This would be awesome! The one thing I'm missing

tmillr commented 3 months ago

You could setup a custom mapping to achieve this. Although it would need access to the plugin's state (the file list for that tab).