Skip to content

Search for symbols by containerName

Created by: sqs

As a user, I would like to be able to quickly search for symbols that are "inside" of other symbols, such as a method inside a namespace in a class. I would like to be able to use fuzzy matching to type the minimum necessary to unambiguously specify what I'm looking for, as in:

image

(from ReSharper: https://www.jetbrains.com/help/resharper/Navigation_and_Search__Go_to_Type.html)

Right now, I need to type the full name, and Sourcegraph doesn't know that dot- or space-separated parts of my query should match on containerName vs. name.

From @dobrou:

Is there any way to search in symbol's `containerName` field?

This field contains full path (namespace,class) of parent symbol. I see it's returned in results, but I can not find any way how to search in it from the query.

I could imagine, that if I write search query like this: type:symbol MyClass.MyMeth If dot '.' is included in searched symbol name, suggestions and search results will give me symbols where MyClass does match symbol.containerName and MyMeth does match symbol.name.

My goal is to get as close as possible to my favorite Resharper feature - https://www.jetbrains.com/help/resharper/Navigation_and_Search__Go_to_Type.html

Simply type eg: type:symbol MyN Cla Met and get quickly to definition like namespace MyNamespace { class MyClass { void Method () {} }}

Requested by https://app.hubspot.com/contacts/2762526/company/557889642