Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

chore: Move and clean up test code for syntactic usages#64318

Merged
kritzcreek merged 4 commits into
mainfrom
christoph/consolidate-codenav-test-helpers
Aug 7, 2024
Merged

chore: Move and clean up test code for syntactic usages#64318
kritzcreek merged 4 commits into
mainfrom
christoph/consolidate-codenav-test-helpers

Conversation

@kritzcreek

Copy link
Copy Markdown
Contributor

Consolidates the two test helper/util modules, and moves one test file to align with the file it's actually testing.

Test plan

Tests continue to pass

@cla-bot cla-bot Bot added the cla-signed label Aug 7, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Aug 7, 2024
@kritzcreek kritzcreek force-pushed the christoph/consolidate-codenav-test-helpers branch from 38a0012 to 186d52d Compare August 7, 2024 03:36
@kritzcreek kritzcreek enabled auto-merge (squash) August 7, 2024 03:40
@kritzcreek kritzcreek force-pushed the christoph/consolidate-codenav-test-helpers branch from 186d52d to 06a15a4 Compare August 7, 2024 06:33
Comment on lines +178 to +187
func (t fakeTranslator) TranslateRange(ctx context.Context, from, to api.CommitID, path core.RepoRelPath, r scip.Range) (core.Option[scip.Range], error) {
numLines := t.numLines
if from == t.to && to == t.from {
numLines = -numLines
}
if t.shouldFail(path, r) {
return core.None[scip.Range](), nil
}
return core.Some(shiftSCIPRange(r, numLines)), nil
}

@antonsviridov-src antonsviridov-src Aug 7, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: r is perhaps too short, may be rng or range.

eventually would be good to kill of the "single letter receiver parameter" convention as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have you know that I'm a big believer in one character variable names 😄

range is a keyword, but I'll change it to range_ in one of the follow-up PRs.

@kritzcreek kritzcreek merged commit 780b5db into main Aug 7, 2024
@kritzcreek kritzcreek deleted the christoph/consolidate-codenav-test-helpers branch August 7, 2024 08:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants