fix: Improve self param completion applicability

This commit is contained in:
Lukas Wirth 2022-07-16 12:17:31 +02:00
parent 25090f0e6d
commit b96f8f18b0
6 changed files with 124 additions and 18 deletions

View file

@ -198,7 +198,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>,
@ -208,6 +208,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 {