Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/completions.rs')
| -rw-r--r-- | crates/ide_completion/src/completions.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide_completion/src/completions.rs b/crates/ide_completion/src/completions.rs index b8a904a3a0..36cee48aed 100644 --- a/crates/ide_completion/src/completions.rs +++ b/crates/ide_completion/src/completions.rs @@ -103,10 +103,14 @@ impl Completions { item.add_to(self); } - pub(crate) fn add_nameref_keywords(&mut self, ctx: &CompletionContext) { + pub(crate) fn add_nameref_keywords_with_colon(&mut self, ctx: &CompletionContext) { ["self::", "super::", "crate::"].into_iter().for_each(|kw| self.add_keyword(ctx, kw)); } + pub(crate) fn add_nameref_keywords(&mut self, ctx: &CompletionContext) { + ["self", "super", "crate"].into_iter().for_each(|kw| self.add_keyword(ctx, kw)); + } + pub(crate) fn add_crate_roots(&mut self, ctx: &CompletionContext) { ctx.process_all_names(&mut |name, res| match res { ScopeDef::ModuleDef(hir::ModuleDef::Module(m)) if m.is_crate_root(ctx.db) => { |