Skip to content

feat: Implement goto_declaration support #9380

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

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jun 22, 2021

This is just a simple implementation that falls back to goto_definition for everything but modules where it goes to the actual module declaration if possible.

@matklad
Copy link
Member

matklad commented Jun 22, 2021

I wonder if goto_definition fallback logically belongs to the client?

@matklad
Copy link
Member

matklad commented Jun 22, 2021

Another natural candidate here are trait methods.

@Veykril
Copy link
Member Author

Veykril commented Jun 23, 2021

I wonder if goto_definition fallback logically belongs to the client?

Good point, it feels like it could belong to the client.

Another natural candidate here are trait methods.

Oh right, I was wondering if there was something else that has the notion of declaration vs definition in rust 👍

@kjeremy
Copy link
Contributor

kjeremy commented Jun 23, 2021 via email

_ => return None,
}
})();
res.or_else(|| goto_definition::goto_definition(db, position))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s put this or_else in the handlers for now, otherwise, LGTM!

@Veykril
Copy link
Member Author

Veykril commented Jun 23, 2021

bors r=matklad

@bors
Copy link
Contributor

bors bot commented Jun 23, 2021

@bors bors bot merged commit b656751 into rust-lang:master Jun 23, 2021
@Veykril Veykril deleted the goto-decl branch June 23, 2021 23:02
@Veykril Veykril mentioned this pull request Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants