Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: support more name formats in symbol search #47841

Open
prattmic opened this issue Aug 20, 2021 · 0 comments
Open

x/pkgsite: support more name formats in symbol search #47841

prattmic opened this issue Aug 20, 2021 · 0 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite/search Issues related to pkg.go.dev search functionality pkgsite

Comments

@prattmic
Copy link
Member

What is the URL of the page with the issue?

  1. https://beta.pkg.go.dev/search?m=symbol&q=Task.CopyInBytes
  2. https://beta.pkg.go.dev/search?m=symbol&q=CopyInBytes
  3. https://beta.pkg.go.dev/search?m=symbol&q=gvisor.dev%2Fgvisor%2Fpkg%2Fsentry%2Fkernel.%28*Task%29.CopyInBytes
  4. https://beta.pkg.go.dev/search?m=symbol&q=%28*Task%29.CopyInBytes

What is your user agent?

Mozilla/5.0 (X11; CrOS x86_64 13982.69.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.130 Safari/537.36

Screenshot

qwdhdhsGmjYqENh

What did you do?

Search for functions named "CopyInBytes".

What did you expect to see?

Functions and methods named "CopyInBytes".

What did you see instead?

Nothing. There is no function named CopyInBytes, only methods. Searching for Task.CopyInBytes works, but it would be nice to support more flexibility in the way of searching.

There are two dimensions to this:

  1. Support the precise symbol name.

This method has a pointer receiver, so the actual name is (*Task).CopyInBytes, but that doesn't return any results. It should also be possible to use the fully qualified symbol name using the package path: gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).CopyInBytes

I think both of these are particularly important for searching for symbols copied directly from a Go stacktrace, which will have this format.

  1. Support searches without the type name.

I may not remember the type name, so it would be nice to be able to search for just the method name: CopyInBytes. I would expect that to include all[1] of these results (other types with this method, including an interface definition).

[1] Except the ones on unexported types I suppose.

@gopherbot gopherbot added this to the Unreleased milestone Aug 20, 2021
@julieqiu julieqiu modified the milestones: Unreleased, pkgsite/search Aug 20, 2021
@julieqiu julieqiu added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 20, 2021
@hyangah hyangah added the pkgsite/search Issues related to pkg.go.dev search functionality label May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite/search Issues related to pkg.go.dev search functionality pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants