rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.79k stars 1.52k forks source link

"Locate child modules", inverse of the "Locate parent modules" feature #17401

Open Veykril opened 2 weeks ago

Veykril commented 2 weeks ago

We currently have a feature that allows running a command to open the parent module(s) of a file's corresponding modules. We should have the inverse of this, opening a popup with the selection of all direct children modules of the currently open file's module(s).

See https://github.com/rust-lang/rust-analyzer/blob/4af21ffb026c7ec3a97a484ca27b36f703eb5fb1/crates/ide/src/parent_module.rs for the parent module implementation, you should be able to trace how this is used to know what to edit to add a similar feature.

This will need an lsp-extension like https://github.com/veykril/rust-analyzer/blob/4af21ffb026c7ec3a97a484ca27b36f703eb5fb1/crates/rust-analyzer/src/lsp/ext.rs#L389-L395 and vscode glue like https://github.com/rust-lang/rust-analyzer/blob/4af21ffb026c7ec3a97a484ca27b36f703eb5fb1/editors/code/src/lsp_ext.ts#L188-L192

randomicon00 commented 2 weeks ago

Hello @Veykril, I would like to work on it!