pub(crate) mod snippet;
pub(crate) mod trait_impl;
pub(crate) mod unqualified_path;
+pub(crate) mod format_string;
use std::iter;
&mut self,
ctx: &CompletionContext,
local_name: hir::Name,
- resolution: &hir::ScopeDef,
+ resolution: hir::ScopeDef,
) {
if ctx.is_scope_def_hidden(resolution) {
cov_mark::hit!(qualified_path_doc_hidden);
return;
}
- self.add_opt(render_resolution(RenderContext::new(ctx), local_name, resolution));
+ self.add(render_resolution(RenderContext::new(ctx), local_name, resolution));
}
pub(crate) fn add_macro(
Some(it) => it,
None => return,
};
- self.add_opt(render_macro(RenderContext::new(ctx), None, name, macro_));
+ self.add(render_macro(RenderContext::new(ctx), None, name, macro_));
}
pub(crate) fn add_function(
if !ctx.is_visible(&func) {
return;
}
- self.add_opt(render_fn(RenderContext::new(ctx), None, local_name, func));
+ self.add(render_fn(RenderContext::new(ctx), None, local_name, func));
}
pub(crate) fn add_method(
if !ctx.is_visible(&func) {
return;
}
- self.add_opt(render_method(RenderContext::new(ctx), None, receiver, local_name, func));
+ self.add(render_method(RenderContext::new(ctx), None, receiver, local_name, func));
}
pub(crate) fn add_const(&mut self, ctx: &CompletionContext, konst: hir::Const) {
) {
let variants = enum_.variants(ctx.db);
- let module = if let Some(module) = ctx.scope.module() {
+ let module = if let Some(module) = ctx.module {
// Compute path from the completion site if available.
module
} else {