From edeec6a41487e6458a9d96b328c9b784525d8f06 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 21 Nov 2018 18:34:20 +0300 Subject: Complete paths after :: --- crates/ra_syntax/src/grammar/items/mod.rs | 2 +- crates/ra_syntax/src/grammar/paths.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/grammar/items/mod.rs b/crates/ra_syntax/src/grammar/items/mod.rs index 06c6b5e6e..682266908 100644 --- a/crates/ra_syntax/src/grammar/items/mod.rs +++ b/crates/ra_syntax/src/grammar/items/mod.rs @@ -29,7 +29,7 @@ pub(super) enum ItemFlavor { Trait, } -const ITEM_RECOVERY_SET: TokenSet = token_set![ +pub(super) const ITEM_RECOVERY_SET: TokenSet = token_set![ FN_KW, STRUCT_KW, ENUM_KW, IMPL_KW, TRAIT_KW, CONST_KW, STATIC_KW, LET_KW, MOD_KW, PUB_KW, CRATE_KW ]; diff --git a/crates/ra_syntax/src/grammar/paths.rs b/crates/ra_syntax/src/grammar/paths.rs index a35a339cc..33a11886c 100644 --- a/crates/ra_syntax/src/grammar/paths.rs +++ b/crates/ra_syntax/src/grammar/paths.rs @@ -78,7 +78,7 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) { // use crate::foo; SELF_KW | SUPER_KW | CRATE_KW => p.bump(), _ => { - p.err_and_bump("expected identifier"); + p.err_recover("expected identifier", items::ITEM_RECOVERY_SET); } }; } -- cgit v1.2.3