Make tests pass

This commit is contained in:
Ryo Yoshida 2022-08-01 15:20:14 +09:00
parent 4322cf7f5b
commit 8fe73a2240
No known key found for this signature in database
GPG Key ID: E25698A930586171
4 changed files with 7 additions and 4 deletions

View File

@ -73,10 +73,12 @@ impl ModDir {
candidate_files.push(self.dir_path.join_attr(attr_path, self.root_non_dir_owner))
}
None if file_id.is_include_macro(db.upcast()) => {
let name = name.unescaped();
candidate_files.push(format!("{}.rs", name));
candidate_files.push(format!("{}/mod.rs", name));
}
None => {
let name = name.unescaped();
candidate_files.push(format!("{}{}.rs", self.dir_path.0, name));
candidate_files.push(format!("{}{}/mod.rs", self.dir_path.0, name));
}

View File

@ -132,9 +132,9 @@ pub struct Bar;
expect![[r#"
crate
Bar: t v
async: t
r#async: t
crate::async
crate::r#async
Bar: t v
"#]],
);

View File

@ -342,7 +342,8 @@ fn render_resolution_simple_(
let ctx = ctx.import_to_add(import_to_add);
let kind = res_to_kind(resolution);
let mut item = CompletionItem::new(kind, ctx.source_range(), local_name.to_smol_str());
let mut item =
CompletionItem::new(kind, ctx.source_range(), local_name.unescaped().to_smol_str());
item.set_relevance(ctx.completion_relevance())
.set_documentation(scope_def_docs(db, resolution))
.set_deprecated(scope_def_is_deprecated(&ctx, resolution));

View File

@ -96,7 +96,7 @@ fn render(
item.set_documentation(ctx.docs(func))
.set_deprecated(ctx.is_deprecated(func) || ctx.is_deprecated_assoc_item(func))
.detail(detail(db, func))
.lookup_by(name.to_smol_str());
.lookup_by(name.unescaped().to_smol_str());
match ctx.completion.config.snippet_cap {
Some(cap) => {