Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Offer choice for Go to definition when target definition is ambiguous #59026

Open
varungandhi-src opened this issue Dec 15, 2023 · 2 comments
Open
Labels
team/code-search Issues owned by the code search team

Comments

@varungandhi-src
Copy link
Contributor

In some cases, such as when we have search-based code intel, or when even with precise code intel, there are multiple sources for the same symbol/definition (or the indexer isn't able to distinguish between the two due to some lazy rules such as that of C++ templates), it is valuable to be able to select a definition site during Go to definition.

Here is an example of how GoLand/IntelliJ does it.

It would be valuable to have a similar UI compared to the current behavior where it picks one result randomly.

@varungandhi-src varungandhi-src added the team/code-search Issues owned by the code search team label Dec 15, 2023
@peterguy
Copy link
Contributor

peterguy commented Apr 1, 2024

@varungandhi-src this is a UX-only (or mostly) change, right? The multiple sources are already available to the UI?

@varungandhi-src
Copy link
Contributor Author

@peterguy in part yes, in part no.

Today, it's possible that the server returns multiple definition results for the same range. https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/cmd/frontend/graphqlbackend/codeintel.codenav.graphql?L94-112

So the client can change the UI to show all of these, and that is fixable without server-side changes.

However, the results provided today are not rich enough to provide a good UX on the client-side. This would be fixed with https://github.com/sourcegraph/sourcegraph/issues/59470

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team/code-search Issues owned by the code search team
Projects
None yet
Development

No branches or pull requests

4 participants