Skip to content

Commit 8fe73a2

Browse files
committed
Make tests pass
1 parent 4322cf7 commit 8fe73a2

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

crates/hir-def/src/nameres/mod_resolution.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ impl ModDir {
7373
candidate_files.push(self.dir_path.join_attr(attr_path, self.root_non_dir_owner))
7474
}
7575
None if file_id.is_include_macro(db.upcast()) => {
76+
let name = name.unescaped();
7677
candidate_files.push(format!("{}.rs", name));
7778
candidate_files.push(format!("{}/mod.rs", name));
7879
}
7980
None => {
81+
let name = name.unescaped();
8082
candidate_files.push(format!("{}{}.rs", self.dir_path.0, name));
8183
candidate_files.push(format!("{}{}/mod.rs", self.dir_path.0, name));
8284
}

crates/hir-def/src/nameres/tests/mod_resolution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ pub struct Bar;
132132
expect![[r#"
133133
crate
134134
Bar: t v
135-
async: t
135+
r#async: t
136136
137-
crate::async
137+
crate::r#async
138138
Bar: t v
139139
"#]],
140140
);

crates/ide-completion/src/render.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ fn render_resolution_simple_(
342342
let ctx = ctx.import_to_add(import_to_add);
343343
let kind = res_to_kind(resolution);
344344

345-
let mut item = CompletionItem::new(kind, ctx.source_range(), local_name.to_smol_str());
345+
let mut item =
346+
CompletionItem::new(kind, ctx.source_range(), local_name.unescaped().to_smol_str());
346347
item.set_relevance(ctx.completion_relevance())
347348
.set_documentation(scope_def_docs(db, resolution))
348349
.set_deprecated(scope_def_is_deprecated(&ctx, resolution));

crates/ide-completion/src/render/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn render(
9696
item.set_documentation(ctx.docs(func))
9797
.set_deprecated(ctx.is_deprecated(func) || ctx.is_deprecated_assoc_item(func))
9898
.detail(detail(db, func))
99-
.lookup_by(name.to_smol_str());
99+
.lookup_by(name.unescaped().to_smol_str());
100100

101101
match ctx.completion.config.snippet_cap {
102102
Some(cap) => {

0 commit comments

Comments
 (0)