Skip to content

codeintel: Rewrite resolvers package

Administrator requested to merge ef/rewrite-resolvers into main

Created by: efritz

Major refactor of the codeintel resolvers package. Fixes both https://github.com/sourcegraph/sourcegraph/issues/15945 and https://github.com/sourcegraph/sourcegraph/issues/15943.

This gets rid of the dependency on the code intel API package from the resolvers package by inlining it. A separate pass will remove now dead code.

This ensures that we are making all calls to gitserver/postgres/codeintel-db on the same (call hierarchy) level so it will be easier to notice where we can omit and batch requests. This should not change any current behavior of the GraphQL API, but may be more efficient due to a more efficient use of database queries.

Major changes:

  • exists.go was taken almost wholesale from the api package.
  • Definitions, Hover, References, Diagnostics, and Ranges resolvers have been removed from query.go and put into their own file. All of the new code should be straightforward to follow. It's best to read this new code as new code and not compare it to previous behavior.

Merge request reports

Loading