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

Add goto support for pattern bindings #1665

Merged
merged 2 commits into from
Oct 5, 2023
Merged

Add goto support for pattern bindings #1665

merged 2 commits into from
Oct 5, 2023

Conversation

jneem
Copy link
Member

@jneem jneem commented Oct 3, 2023

Adds support for going to the "definition" of bindings in a let pattern. For example, in

let { foo } = bar in ...

a "goto definition" request for foo will jump to wherever the "foo" field of bar is defined.

@github-actions github-actions bot temporarily deployed to pull request October 3, 2023 23:20 Inactive
} else {
vec![]
}
fn get_defs(term: &RichTerm, ident: Option<LocIdent>, server: &Server) -> Option<Vec<LocIdent>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a semantic difference between None and Some(vec![]) here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but changing it to Option<Vec> allows ? for early return

@jneem jneem added this pull request to the merge queue Oct 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 5, 2023
@jneem jneem enabled auto-merge October 5, 2023 00:37
@github-actions github-actions bot temporarily deployed to pull request October 5, 2023 00:41 Inactive
@jneem jneem added this pull request to the merge queue Oct 5, 2023
Merged via the queue into master with commit 8eae2c7 Oct 5, 2023
5 checks passed
@jneem jneem deleted the goto-patterns branch October 5, 2023 01:04
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.

2 participants