Add menu for searching symbols by type/kind instead of name #6037
-
I find myself not using the "symbol picker" feature very much (space + s) since in the large projects I work on there are so many symbols and I rarely know what I want just by name, but one is so that we don't have to have stupid naming conventions for types of different kinds because editor tooling support for the type-system has been great. The types of queries I'm more often more interested in is
One way of achieving this (in terms of ui and rust specifically, not thinking too hard about other languages atm) would be to support better queries/filters within the symbol picker search. An easy win for Rust at least, would be to instead of just containing the symbol's name in the search, the prefix like "const", "fn", "struct", "enum" would be part of the searchable names. For example, if you have a file containing the struct struct MyStruct {
field: f32
}
fn my_func(a: &mut MyStruct) {
// ..
} and you open the symbol picker (or perhaps a separate new dialog that does this behaviour instead), it would list "struct MyStruct", "fn my_func" instead of just the names "MyStruct", "my_func" in a huge list of things. That way, I would be able to filter on all structs by searching "struct", and then be able to narrow down the search by names once I see the list of all the structs. Similairly for enums, consts, functions etc. I don't want to have to use naming conventions like calling all my structs I don't know if this would be feasible to implement in a general enough way to support many languages, but would be cool for Rust! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
A completely different approach to solve my problem might be to just have a fuzzy-search picker like the Searching '/ + struct ' and then spamming "n" is not as nice as if it was just a dropdown immediately showing all the results. This way it would be language agnostic. |
Beta Was this translation helpful? Give feedback.
-
Tracked by #5446. |
Beta Was this translation helpful? Give feedback.
-
Maybe I just want ripgrep integration in helix xP |
Beta Was this translation helpful? Give feedback.
-
Yup #196 sounds more in line to what I would like to have xP I don't care too much about the global search with a list of file-names though and would rather just have all the search results in the picker instead. |
Beta Was this translation helpful? Give feedback.
Tracked by #5446.