/// Complete mod declaration, i.e. `mod <|> ;`
pub(super) fn complete_mod(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> {
- let mod_under_caret = match &ctx.mod_under_caret {
+ let mod_under_caret = match &ctx.mod_declaration_under_caret {
Some(mod_under_caret) if mod_under_caret.item_list().is_some() => return None,
Some(mod_under_caret) => mod_under_caret,
None => return None,
pub(super) is_path_type: bool,
pub(super) has_type_args: bool,
pub(super) attribute_under_caret: Option<ast::Attr>,
- pub(super) mod_under_caret: Option<ast::Module>,
+ pub(super) mod_declaration_under_caret: Option<ast::Module>,
pub(super) unsafe_is_prev: bool,
pub(super) if_is_prev: bool,
pub(super) block_expr_parent: bool,
has_type_args: false,
dot_receiver_is_ambiguous_float_literal: false,
attribute_under_caret: None,
- mod_under_caret: None,
+ mod_declaration_under_caret: None,
unsafe_is_prev: false,
in_loop_body: false,
ref_pat_parent: false,
self.is_match_arm = is_match_arm(syntax_element.clone());
self.has_item_list_or_source_file_parent =
has_item_list_or_source_file_parent(syntax_element.clone());
- self.mod_under_caret = find_node_at_offset(&file_with_fake_ident, offset);
+ self.mod_declaration_under_caret =
+ find_node_at_offset::<ast::Module>(&file_with_fake_ident, offset)
+ .filter(|module| module.item_list().is_none());
}
fn fill(