3
4pub(crate) mod const_;
5▶pub(crate) mod function;
6pub(crate) mod literal;
7pub(crate) mod macro_;
· · ·
29 item::{Builder, CompletionRelevanceTypeMatch},
30 render::{
31▶ function::render_fn,
32 literal::render_variant_lit,
33 macro_::{render_macro, render_macro_pat},
· · ·
100 ///
101 /// In order to be able to check for the latter, we'd ideally want to `try_as_dyn<_, dyn AsAssocItem>(def)`
102▶ /// (see [`try_as_dyn`][]), but that function is currently unstable. Therefore, we employ a hack instead:
103 /// if `def` can be an assoc item, it should be passed to this method as follows:
104 /// ```ignore
· · ·
160 let mut builder = TextEdit::builder();
161 // Using TextEdit, insert '(' before the struct name and ')' before the
162▶ // dot access, then comes the field name and optionally insert function
163 // call parens.
164
· · ·
372) -> Option<hir::Name> {
373 Some(match resolution {
374▶ ScopeDef::ModuleDef(hir::ModuleDef::Function(f)) => f.name(ctx.completion.db),
375 ScopeDef::ModuleDef(hir::ModuleDef::Const(c)) => c.name(ctx.completion.db)?,
376 ScopeDef::ModuleDef(hir::ModuleDef::TypeAlias(t)) => t.name(ctx.completion.db),
+ 150 more matches in this file