This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Resolve syntactic symbol at request range#63189
Merged
kritzcreek merged 11 commits intomainfrom Jun 12, 2024
Merged
Conversation
Contributor
|
I've moved the utility functions to the SCIP repo. sourcegraph/scip#248 Rationale for the change:
|
9026896 to
f04d3b9
Compare
varungandhi-src
suggested changes
Jun 11, 2024
Contributor
varungandhi-src
left a comment
There was a problem hiding this comment.
Left some initial comments, key one is changing the signature of the getSyntacticSymbolsAtRange function.
varungandhi-src
approved these changes
Jun 12, 2024
Contributor
There was a problem hiding this comment.
Is this purely a matter of calling GitTreeTranslator.GetTargetCommitRangeFromSourceRange? If so, let's fix this right away instead of accruing a TODO.
Contributor
Author
There was a problem hiding this comment.
GitTreeTranslator is also a cache and has a relatively complicated API, might be a good candidate to look at during pairing.
added 11 commits
June 12, 2024 18:24
I'm hoping we don't need this for the MVP, but it's important not to forget about it
d605278 to
7194c00
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://linear.app/sourcegraph/issue/GRAPH-666/resolve-syntactic-symbol-at-the-range-specified-in-the-usages-request
Because the new occurrences API allows passing both a symbol or a range we need to be able to retrieve the syntactic symbol at the given range.
I added some utilty functions to the
shared.Rangeandshared.Positiontypes, which I assume are the position-ish types we want to use to communicate between resolver and codenav service code.I left a few NOTE and TODO's that I'd like to discuss during review.
Test plan
I added both unit as well as property based tests for the utility functions on position and range.
In order to test the service functions I'd need to mock a bunch of systems, and I'm not sure if the test would have any meaning at that point (the logic is basically a single iteration and overlap check). If you'd like me to add it anyways let me know.