sourcegraph/dev/linters
Varun Gandhi 6d981c60ad
chore: Update main occurrence extraction code to allow for symbol-based matching (#64082)
At the heart of the loop for extracting usages across a Sourcegraph
instance is the `extractLocationsFromPosition` function, which
extracts related symbols and source ranges from a single SCIP
Document. (Source ranges for returning to the user directly,
and related symbols to do further lookups, e.g. in the case
of inheritance.)

Since we want to perform matching based on symbol names in the upcoming
precise usagesForSymbol API, and also return symbol names for each
associated source range, this function needs to be updated to:
1. Be able to take a symbol name for doing lookups. This is done using
    the new `FindUsagesKey` type which allows two cases - position-based and
    symbol-based.
2. Be able to return symbol names associated with every source range.
    This is done by creating a new `UsageBuilder` type which somewhat subsumes
    the `Location` type. We avoid copying the same 'UploadID' and 'Path'
    fields eagerly for clarity; that will be handled by callers in the future when
    they mix `UsageBuilder` values across different Documents (by first calling `build`).

For the above, I've introduced a new func `extractRelatedUsagesAndSymbolNames`,
and `extractLocationsFromPosition` delegates to that. In the future,
`extractLocationsFromPosition` will be removed.
2024-07-26 18:28:43 +08:00
..
bodyclose bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
dbconn support fast, simple sg start single-program-experimental-blame-sqs for local dev (#63435) 2024-06-24 21:12:47 +00:00
depguard chore: Centralize languages package as source-of-truth (#63292) 2024-06-18 13:10:24 +00:00
exhaustruct chore: Update main occurrence extraction code to allow for symbol-based matching (#64082) 2024-07-26 18:28:43 +08:00
forbidigo bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
gocheckcompilerdirectives bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
gocritic bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
ineffassign bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
logging bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
nolint bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
nolocalhost bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
staticcheck bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
tracinglibraries bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
unparam bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
unused bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
go.mod feat(build): Add exhaustruct linter (codeintel POC) (#63965) 2024-07-23 17:26:01 +08:00
go.sum feat(build): Add exhaustruct linter (codeintel POC) (#63965) 2024-07-23 17:26:01 +08:00