7

In IntelliJ IDEA when I press Ctrl+Shift+Alt+N, I can search and go to any symbol from all the code that is accessible within the project. For example, in a Java Maven project, Go To Symbol would search all symbols across the JDK standard library, all the Maven dependencies of your project, and your project source code. Is there a way to search/list/goto any symbol like that in VSCode please?

A bit more context: it's a Rust project via rust-analyzer extension. The use case is, I vaguely remember something somewhere had a method with a specific word in it, but I have no idea where (stdlib? dependent crates? my code?). I'd like to input that word and get a list of all the symbols that match it.

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
Yuri Geinish
  • 16,744
  • 6
  • 38
  • 40
  • Doesn't `CtrlT` work for you? In my setup, it is a default keybinding with the following action: { "key": "ctrl+t", "command": "workbench.action.showAllSymbols" } – Tryer Sep 30 '21 at 02:12
  • 2
    @Tryer `Ctrl+T` doesn't seem to be aware of anything outside my project's immediate source code. It checks neither Rust's stdlib symbols, nor the source code of Cargo dependencies. Quick example: In vscode, `Ctrl+T` and `map_err` gives no results. In IDEA, `Ctrl+Shift+Alt+N` and `map_err` gives `core::result::map_err`, `core::task::poll::map_err` and so on. – Yuri Geinish Sep 30 '21 at 02:29
  • https://github.com/rust-lang/rust-analyzer/issues/13938 And there is a link to https://rust-analyzer.github.io/manual.html#workspace-symbol which describes how to enable this functionality. – romamik Feb 10 '23 at 11:23

1 Answers1

2

I had the same problem, and I found a solution. You can write out the symbol you're looking for in plain code, and then use your keybinding for go to definition (F12 for me). I know this is a bit of a hack, but it works.

e.g. you're interested in the type String, so you write out String in your code and press F12.