aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
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
parent590472607c9629fdd37e3f6f33dacfdc2a3f56cc (diff)
Don't complete values in type position
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/lib.rs12
-rw-r--r--crates/hir/src/semantics.rs3
2 files changed, 14 insertions, 1 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 {
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 2d08a7704..827e23e2b 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -35,8 +35,9 @@ pub enum PathResolution {
35 Def(ModuleDef), 35 Def(ModuleDef),
36 /// A local binding (only value namespace) 36 /// A local binding (only value namespace)
37 Local(Local), 37 Local(Local),
38 /// A generic parameter 38 /// A type parameter
39 TypeParam(TypeParam), 39 TypeParam(TypeParam),
40 /// A const parameter
40 ConstParam(ConstParam), 41 ConstParam(ConstParam),
41 SelfType(Impl), 42 SelfType(Impl),
42 Macro(MacroDef), 43 Macro(MacroDef),