aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/runnables.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-25 03:30:47 +0100
committerGitHub <[email protected]>2021-05-25 03:30:47 +0100
commit8b049ec393230e4b9fea3022a3ebf34e2af5395d (patch)
treed75b9290e907898027eab2e723ed1c0040e43e4e /crates/ide/src/runnables.rs
parent6d473c0a8f6acecbae680b69528b3f88a31dc5fc (diff)
parentd75277b66b07e3fa4fed5088b92c6f65b2de8fe9 (diff)
Merge #8942
8942: Add `library` semantic token modifier to items from other crates r=arzg a=arzg Closes #5772. A lot of code here is pretty repetitive; please let me know if you have any ideas how to improve it, or whether it’s fine as-is. Side-note: How can I add tests for this? I don’t see a way for the test Rust code in `test_highlighting` to reference other crates to observe the new behaviour. Co-authored-by: Aramis Razzaghipour <[email protected]>
Diffstat (limited to 'crates/ide/src/runnables.rs')
-rw-r--r--crates/ide/src/runnables.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs
index f76715d84..ce1c76f37 100644
--- a/crates/ide/src/runnables.rs
+++ b/crates/ide/src/runnables.rs
@@ -227,7 +227,7 @@ pub(crate) fn runnable_fn(sema: &Semantics<RootDatabase>, def: hir::Function) ->
227 let func = def.source(sema.db)?; 227 let func = def.source(sema.db)?;
228 let name_string = def.name(sema.db).to_string(); 228 let name_string = def.name(sema.db).to_string();
229 229
230 let root = def.krate(sema.db)?.root_module(sema.db); 230 let root = def.module(sema.db).krate().root_module(sema.db);
231 231
232 let kind = if name_string == "main" && def.module(sema.db) == root { 232 let kind = if name_string == "main" && def.module(sema.db) == root {
233 RunnableKind::Bin 233 RunnableKind::Bin