Fix GitHub snippet resolution
Created by: lguychard
Fixes #771 Fixes #3105 Fixes #3110
Deprecates commentSnippetCodeViewResolver
, which:
- Matched entire comments, even though they may have contained several snippets (#3110)
- Used the first link whose href could be parsed by
getGitHubState()
, which could be any inline link in a GitHub comment (#771)
Snippet code views are now resolved using the fileLineContainerResolver
, to the closes element containing both the code and the permalink. Several snippets contained in the same comment can be accurately resolved.
Test Plan
Code Hosts
-
GitHub -
GitHub Enterprise -
Refined GitHub -
Phabricator -
Phabricator integration -
Bitbucket -
Gitlab
Browsers
-
Chrome -
Firefox
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #3920 into master will decrease coverage by
0.1%
. The diff coverage is25%
.Impacted Files Coverage Δ browser/src/libs/github/util.tsx 29.62% <ø> (+2.22%)
browser/src/libs/github/code_intelligence.ts 51.26% <0%> (-1.74%)
browser/src/libs/github/file_info.ts 21.95% <30.76%> (ø)
cmd/frontend/backend/go_importers.go 22.22% <0%> (-37.5%)
cmd/frontend/backend/repos_vcs.go 22.03% <0%> (-7.63%)
cmd/frontend/backend/repos.go 28.71% <0%> (-2.98%)
cmd/repo-updater/repos/migrations.go 69.66% <0%> (-0.71%)
Created by: lguychard
Yeah, I was holding off for !3976 (closed), but we can merge without it.
Please register or sign in to reply