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

chore: Bubble precise Usages instead of Locations#64118

Merged
varungandhi-src merged 5 commits into
mainfrom
vg/plumb-usages
Jul 29, 2024
Merged

chore: Bubble precise Usages instead of Locations#64118
varungandhi-src merged 5 commits into
mainfrom
vg/plumb-usages

Conversation

@varungandhi-src

@varungandhi-src varungandhi-src commented Jul 29, 2024

Copy link
Copy Markdown
Contributor

This patch changes the code so that the core APIs we need
for precise usagesForSymbol actually return (Upload)Usages instead
of just (Upload)Locations, so that we have the usage kind information
as well as the symbol names available. I will be handling the GraphQL layer
for converting the Usages to appropriate Resolvers in a follow-up PR.

Test plan

Modified a bunch of existing mock tests. 🤷🏽

@cla-bot cla-bot Bot added the cla-signed label Jul 29, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jul 29, 2024
Comment thread internal/codeintel/codenav/service_new_test.go Outdated
Comment thread internal/codeintel/codenav/transport/graphql/root_resolver_usages.go Outdated
Comment thread internal/codeintel/codenav/transport/graphql/root_resolver.go Outdated
Comment thread internal/codeintel/codenav/shared/types.go

@kritzcreek kritzcreek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some things I spotted, will work through the rest in a bit

Comment thread internal/codeintel/codenav/service.go Outdated
Comment thread internal/codeintel/codenav/shared/types.go
Comment thread internal/codeintel/codenav/shared/types.go Outdated

@kritzcreek kritzcreek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@varungandhi-src varungandhi-src merged commit 963792f into main Jul 29, 2024
@varungandhi-src varungandhi-src deleted the vg/plumb-usages branch July 29, 2024 12:12
varungandhi-src added a commit that referenced this pull request Jul 31, 2024
This patch wires up the newly changed APIs in #64118 
to the GraphQL API, enabling precise support in the
usagesForSymbol API. It also handles pagination.

Fixes https://linear.app/sourcegraph/issue/GRAPH-573

## Test plan

Manually tested. Will add automated tests in follow-up PR.

## Changelog

- Adds support for precise code navigation to the experimental
`usagesForSymbol` API, which can be used to implement a
  reference panel or similar functionality.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants