Marks search-based usages as definitions or references#63576
Marks search-based usages as definitions or references#63576kritzcreek merged 2 commits intomainfrom
Conversation
|
I might've out-gitted myself and needed to |
varungandhi-src
left a comment
There was a problem hiding this comment.
Looks OK but let's reduce the code duplication
There was a problem hiding this comment.
Should this be taking in a commit parameter similar to the function above or is that deliberately omitted?
There was a problem hiding this comment.
Before this call, it might be useful to do something like:
trace = trace.With(log.String("language", language), log.String("symbolName", symbolName), log.Int("syntacticUploadID", syntacticUploadID))
This will create a new TraceLogger which auto-attaches the supplied values to subsequent messages (such as the Warn call)
There was a problem hiding this comment.
Should this be taking in a commit parameter similar to the function above or is that deliberately omitted?
It's delibarately omitted. Specifying a rev parameter on a symbol seemingly makes it return nothing, but now that I think about it that would mean we should only do definition detection for current HEAD. I'll take another look at what the webapp does.
There was a problem hiding this comment.
Specifying a rev parameter on a symbol seemingly makes it return nothing
That shouldn't be happening 🤔 For example:
There was a problem hiding this comment.
I'm very confused still, but you're right in all my current testing it's fine to filter by rev for symbol search. I've unified the query generation and search arguments.
There was a problem hiding this comment.
Normally I'd suggest following a rule of 3, but given that the implementation is largely the same as that for findCandidateOccurrencesViaSearch (and AFAICT we don't expect it to change much in the future), thoughts on combining the implementation for the two?
We do this by running a type:symbol search and marking all overlapping results as definitions
0961577 to
db58003
Compare
Also adds back commit filtering for symbol search
Closes https://linear.app/sourcegraph/issue/GRAPH-712/determine-usage-kind-for-search-based-usages-by-running-symbol-search
We do this by running a type:symbol search and marking all overlapping results as definitions
Test plan
Here's an example query to run in the API console