chore: Move codenav types to lower-level package#64141
Conversation
| "golang.org/x/exp/rand" | ||
|
|
||
| "github.com/stretchr/testify/require" |
There was a problem hiding this comment.
| "golang.org/x/exp/rand" | |
| "github.com/stretchr/testify/require" | |
| "golang.org/x/exp/rand" | |
| "github.com/stretchr/testify/require" |
| LocationOffset int `json:"locationOffset"` | ||
| } | ||
|
|
||
| type UsagesForSymbolResolvedArgs struct { |
There was a problem hiding this comment.
nit: Where possible I'd prefer declaring types next to their primary usage. Could this type be declared in service.go next to the "PreciseUsages" function that accepts it?
There was a problem hiding this comment.
There are a fair number of types here, and service.go/service_new.go primarily have the logic for the service methods themselves (whereas this file houses the related type definitions), so I'd rather keep the types in this file following the existing code.
There was a problem hiding this comment.
There is a similar pattern in codenav/shared/types.go and uploads/shared/types.go where the main types involved in parameters/results and their methods are defined in a separate types.go file
For https://github.com/sourcegraph/sourcegraph/pull/64126, I need to be able to
access some of these types in the codenav package directly, so move these
to avoid an import cycle: codenav -> resolvers -> codenav.
Test plan
Covered by existing tests