Open felixfbecker opened 4 years ago
@fkling any reason we can't add a command+enter shortcut to symbols like we do for repos?
@camdencheek The main reason for not doing that is that we dedupe symbol suggestions. I.e. if a symbol is references ten times we only show it once. If we want to make command+enter possible then we should not dedupe and add additional information (file, line) to make it possible to distinguish the locations.
However, I wonder how useful that really is. What I think would be more useful is if we could only suggest the definition of the symbol and make that "jumpable", but I don't think we can do that.
if we could only suggest the definition of the symbol
I'm not super familiar with symbol search, but it looks like it only returns definitions? e.g., this search does not return any of the places SearchInts
is used
I'll have to take a look again then. I remember that we showed lots of duplicate useState
suggestions in the past.
Ah, interesting. I can reproduce with useState
in imports. It looks like maybe this is because, in Javascript, imports are treated as destructures, so we're declaring a file-local variable with the same name as the imported object in the remote file.
cc Graph (@varun.gandhi and @anton.sviridov since Linear doesn't support team pings) in case you two have any ideas about yielding only symbols that make sense as jump targets.
With the old search field, often I would go (or scope) to a repo, then type the name of a symbol. I'd then get symbol suggestions, select one, and jump to it.
The new smart search field shows suggestions for the symbol, but selecting it just completes it, and hitting enter just submits a text search for the symbol.
This breaks this flow of using the search box to quickly find and jump to a symbol.
The problem is also there for files, but at least those will by default show up in the result list.
I can see different possible solutions:
type:symbol
when selecting a symbol suggestion