aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/lib.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-08 15:50:10 +0100
committerLukas Wirth <[email protected]>2021-06-08 15:50:10 +0100
commit1d74ef1d989b3d37f3f08d32e88670ee0f1f7ab6 (patch)
tree33560270745b1f2ad509612dc404683af7ffa6ed /crates/hir/src/lib.rs
parent590472607c9629fdd37e3f6f33dacfdc2a3f56cc (diff)
Don't complete values in type position
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index c2b68a853..589641760 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -2496,6 +2496,18 @@ impl ScopeDef {
2496 2496
2497 items 2497 items
2498 } 2498 }
2499
2500 pub fn is_value_def(&self) -> bool {
2501 matches!(
2502 self,
2503 ScopeDef::ModuleDef(ModuleDef::Function(_))
2504 | ScopeDef::ModuleDef(ModuleDef::Variant(_))
2505 | ScopeDef::ModuleDef(ModuleDef::Const(_))
2506 | ScopeDef::ModuleDef(ModuleDef::Static(_))
2507 | ScopeDef::GenericParam(GenericParam::ConstParam(_))
2508 | ScopeDef::Local(_)
2509 )
2510 }
2499} 2511}
2500 2512
2501impl From<ItemInNs> for ScopeDef { 2513impl From<ItemInNs> for ScopeDef {