aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db/src/defs.rs
diff options
context:
space:
mode:
authorZac Pullar-Strecker <[email protected]>2020-06-16 05:52:40 +0100
committerZac Pullar-Strecker <[email protected]>2020-06-30 09:10:24 +0100
commit10c50b140aa67f74a135e7a48ff6d954cc757cb8 (patch)
tree2dddde4014e887ef57a4be68f8c00a2816c22ac7 /crates/ra_ide_db/src/defs.rs
parentf9893d370c4c3b015698169d27d2833742441560 (diff)
Format & replace todos with 'fixme'
Diffstat (limited to 'crates/ra_ide_db/src/defs.rs')
-rw-r--r--crates/ra_ide_db/src/defs.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index a158169e3..b07395a64 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -6,8 +6,9 @@
6// FIXME: this badly needs rename/rewrite (matklad, 2020-02-06). 6// FIXME: this badly needs rename/rewrite (matklad, 2020-02-06).
7 7
8use hir::{ 8use hir::{
9 db::{DefDatabase, HirDatabase},
9 Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution, 10 Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution,
10 Semantics, TypeParam, Visibility, db::{DefDatabase, HirDatabase}, 11 Semantics, TypeParam, Visibility,
11}; 12};
12use ra_prof::profile; 13use ra_prof::profile;
13use ra_syntax::{ 14use ra_syntax::{
@@ -16,7 +17,7 @@ use ra_syntax::{
16}; 17};
17 18
18use crate::RootDatabase; 19use crate::RootDatabase;
19use ra_hir_def::resolver::{Resolver, HasResolver}; 20use ra_hir_def::resolver::{HasResolver, Resolver};
20 21
21// FIXME: a more precise name would probably be `Symbol`? 22// FIXME: a more precise name would probably be `Symbol`?
22#[derive(Debug, PartialEq, Eq, Copy, Clone)] 23#[derive(Debug, PartialEq, Eq, Copy, Clone)]
@@ -83,12 +84,14 @@ impl Definition {
83 use ra_hir_def::*; 84 use ra_hir_def::*;
84 Some(match self { 85 Some(match self {
85 Definition::ModuleDef(def) => def.resolver(db)?, 86 Definition::ModuleDef(def) => def.resolver(db)?,
86 Definition::Field(field) => Into::<VariantId>::into(Into::<VariantDef>::into(field.parent_def(db))).resolver(db), 87 Definition::Field(field) => {
88 Into::<VariantId>::into(Into::<VariantDef>::into(field.parent_def(db))).resolver(db)
89 }
87 Definition::Macro(m) => Into::<ModuleId>::into(m.module(db)?).resolver(db), 90 Definition::Macro(m) => Into::<ModuleId>::into(m.module(db)?).resolver(db),
88 Definition::SelfType(imp) => Into::<ImplId>::into(imp.clone()).resolver(db), 91 Definition::SelfType(imp) => Into::<ImplId>::into(imp.clone()).resolver(db),
89 // it's possible, read probable, that other arms of this are also unreachable 92 // it's possible, read probable, that other arms of this are also unreachable
90 Definition::Local(_local) => unreachable!(), 93 Definition::Local(_local) => unreachable!(),
91 Definition::TypeParam(tp) => Into::<ModuleId>::into(tp.module(db)).resolver(db) 94 Definition::TypeParam(tp) => Into::<ModuleId>::into(tp.module(db)).resolver(db),
92 }) 95 })
93 } 96 }
94} 97}