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

feat(wip): more robust autocomplete of self keyword in complete_fn_param #9575

Closed
wants to merge 1 commit into from

Conversation

jhgg
Copy link
Contributor

@jhgg jhgg commented Jul 12, 2021

wip, based off of @Veykril's comments in #9548 for #9522.

things to do:

For the last item, is there any good example I can look at on how to do it? Also please let me know if this is what you had in mind!

@@ -487,6 +489,8 @@ impl<'a> CompletionContext<'a> {
let for_is_prev2 = for_is_prev2(syntax_element.clone());
(fn_is_prev && !inside_impl_trait_block) || for_is_prev2
};
// todo(jake): is this the right place to put this?
self.param_def = find_node_at_offset(&file_with_fake_ident, offset);
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just replace the is_param field with the param_def and check for is_some where the former was used.

Assigning param_def should be done where is_param is assigned then.

return None;
}

// todo: handle ampersand... somehow?
Copy link
Member

Choose a reason for hiding this comment

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

ctx.previous_token

@Veykril
Copy link
Member

Veykril commented Jul 21, 2021

Just a headsup, the tests for this module have moved in #9669 so you will have to do a rebase when you get back to this.

@Veykril
Copy link
Member

Veykril commented Aug 30, 2021

Closing due to inactivity, feel free to reopen if you are making progress on this again.

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