Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client -> server requst: Goto Parent Module #1002

Open
matklad opened this issue May 25, 2020 · 4 comments
Open

client -> server requst: Goto Parent Module #1002

matklad opened this issue May 25, 2020 · 4 comments
Labels
feature-request Request for new features or functionality new request
Milestone

Comments

@matklad
Copy link
Contributor

matklad commented May 25, 2020

Parent Module

Server Capability: { "parentModule": boolean }

This request is send from client to server to handle "Goto Parent Module" editor action.

Method: experimental/parentModule

Request: TextDocumentPositionParams

Response: Location | Location[] | LocationLink[] | null

Example

// src/main.rs
mod foo;


// src/foo.rs

/* cursor here*/

experimental/parentModule returns a single Link to the mod foo; declaration.

Unresolved Question

  • An alternative would be to use a more general "gotoSuper" request, which would work for super methods, super classes and super modules. This is the approach IntelliJ Rust is takeing. However, experience shows that super module (which generally has a feeling of navigation between files) should be separate. If you want super module, but the cursor happens to be inside an overriden function, the behavior with single "gotoSuper" request is surprising.
@rcjsuen
Copy link
Contributor

rcjsuen commented May 25, 2020

Response: Location | Location[] | LocationLink[] | null

Would multiple files be opened if an array was returned?

@matklad
Copy link
Contributor Author

matklad commented May 25, 2020

The client should use exactly the same logic it uses for handling other goto definition requests (we use exactly the same return type for goto definition and goto to type I belive). Usually, the logic is to show a drop-down with for choosing which location exactly do you want to go to.

@dbaeumer dbaeumer added the feature-request Request for new features or functionality label May 26, 2020
@dbaeumer dbaeumer added this to the Backlog milestone May 26, 2020
@dbaeumer
Copy link
Member

@jrieken do we have a comparable request in VS Code ?

@Septias
Copy link

Septias commented Nov 11, 2024

Why has this staled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality new request
Projects
None yet
Development

No branches or pull requests

4 participants