Skip to content

search: fix symbol match URLs - #7

Merged
bobheadxi merged 2 commits into
mainfrom
fix-symbols-match-url
Feb 16, 2022
Merged

bobheadxi merged 2 commits into
mainfrom
fix-symbols-match-url

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Feb 16, 2022 •

Copy link
Copy Markdown
Owner

As reported in #6 . Symbol match URL is a full path, e.g.

/github.com/sourcegraph/sourcegraph@rockskip-symbols/-/blob/enterprise/internal/rockskip/lib.go#L918:6-918:16

The getMatchURL copied from stream.ts gives us most of the same thing, and I was appending this URL to the match URL, creating an invalid URL. I could append this to src.instance instead, but for consistency with content matches which append ?${lineNumber}, I've added a preprocessor to turn url into just the anchor link and append it to the match URL.

Closes #6

Tested:

  • single result match, e.g. repo:github.com/sourcegraph/sourcegraph@rockskip-symbols type:symbol queryBlobs
  • multi result symbol match, e.g. context:@sourcegrapha/all monitoring type:symbol f:gcp

@bobheadxi
bobheadxi merged commit 695282d into main Feb 16, 2022
@bobheadxi
bobheadxi deleted the fix-symbols-match-url branch February 16, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

symbol match URL is incorrect

1 participant