aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/completions.rs')
-rw-r--r--crates/ide_completion/src/completions.rs29
1 files changed, 19 insertions, 10 deletions
diff --git a/crates/ide_completion/src/completions.rs b/crates/ide_completion/src/completions.rs
index 09882c4f3..cdac4e41a 100644
--- a/crates/ide_completion/src/completions.rs
+++ b/crates/ide_completion/src/completions.rs
@@ -2,25 +2,27 @@
2 2
3pub(crate) mod attribute; 3pub(crate) mod attribute;
4pub(crate) mod dot; 4pub(crate) mod dot;
5pub(crate) mod record; 5pub(crate) mod flyimport;
6pub(crate) mod pattern;
7pub(crate) mod fn_param; 6pub(crate) mod fn_param;
8pub(crate) mod keyword; 7pub(crate) mod keyword;
9pub(crate) mod snippet; 8pub(crate) mod lifetime;
10pub(crate) mod qualified_path;
11pub(crate) mod unqualified_path;
12pub(crate) mod postfix;
13pub(crate) mod macro_in_item_position; 9pub(crate) mod macro_in_item_position;
14pub(crate) mod trait_impl;
15pub(crate) mod mod_; 10pub(crate) mod mod_;
16pub(crate) mod flyimport; 11pub(crate) mod pattern;
12pub(crate) mod postfix;
13pub(crate) mod qualified_path;
14pub(crate) mod record;
15pub(crate) mod snippet;
16pub(crate) mod trait_impl;
17pub(crate) mod unqualified_path;
17 18
18use std::iter; 19use std::iter;
19 20
20use hir::{known, ModPath, ScopeDef, Type}; 21use hir::{known, ModPath, ScopeDef, Type};
22use ide_db::SymbolKind;
21 23
22use crate::{ 24use crate::{
23 item::Builder, 25 item::{Builder, CompletionKind},
24 render::{ 26 render::{
25 const_::render_const, 27 const_::render_const,
26 enum_variant::render_variant, 28 enum_variant::render_variant,
@@ -31,7 +33,7 @@ use crate::{
31 type_alias::render_type_alias, 33 type_alias::render_type_alias,
32 RenderContext, 34 RenderContext,
33 }, 35 },
34 CompletionContext, CompletionItem, 36 CompletionContext, CompletionItem, CompletionItemKind,
35}; 37};
36 38
37/// Represents an in-progress set of completions being built. 39/// Represents an in-progress set of completions being built.
@@ -77,6 +79,13 @@ impl Completions {
77 self.add(item); 79 self.add(item);
78 } 80 }
79 81
82 pub(crate) fn add_static_lifetime(&mut self, ctx: &CompletionContext) {
83 let mut item =
84 CompletionItem::new(CompletionKind::Reference, ctx.source_range(), "'static");
85 item.kind(CompletionItemKind::SymbolKind(SymbolKind::LifetimeParam));
86 self.add(item.build());
87 }
88
80 pub(crate) fn add_resolution( 89 pub(crate) fn add_resolution(
81 &mut self, 90 &mut self,
82 ctx: &CompletionContext, 91 ctx: &CompletionContext,