Auto merge of #12773 - Veykril:self-compl, r=Veykril

fix: Improve self param completion applicability

Fixes https://github.com/rust-lang/rust-analyzer/issues/9522
This commit is contained in:
bors 2022-07-16 10:28:52 +00:00
commit 96481b7786
6 changed files with 124 additions and 18 deletions

View file

@ -199,7 +199,7 @@ pub(super) enum Qualified {
#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) struct PatternContext {
pub(super) refutability: PatternRefutability,
pub(super) param_ctx: Option<(ast::ParamList, ast::Param, ParamKind)>,
pub(super) param_ctx: Option<ParamContext>,
pub(super) has_type_ascription: bool,
pub(super) parent_pat: Option<ast::Pat>,
pub(super) ref_token: Option<SyntaxToken>,
@ -209,6 +209,13 @@ pub(super) struct PatternContext {
pub(super) impl_: Option<ast::Impl>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) struct ParamContext {
pub(super) param_list: ast::ParamList,
pub(super) param: ast::Param,
pub(super) kind: ParamKind,
}
/// The state of the lifetime we are completing.
#[derive(Debug)]
pub(super) struct LifetimeContext {