From 4f5f608b499ad50aa66b2213e3b92dd2fe61ed68 Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Mon, 24 Aug 2020 20:26:45 +1200 Subject: Reorganise code --- crates/ra_ide_db/Cargo.toml | 1 - crates/ra_ide_db/src/defs.rs | 17 ----------------- 2 files changed, 18 deletions(-) (limited to 'crates/ra_ide_db') diff --git a/crates/ra_ide_db/Cargo.toml b/crates/ra_ide_db/Cargo.toml index f345f1de8..2716a38cc 100644 --- a/crates/ra_ide_db/Cargo.toml +++ b/crates/ra_ide_db/Cargo.toml @@ -26,7 +26,6 @@ ra_text_edit = { path = "../ra_text_edit" } ra_db = { path = "../ra_db" } ra_prof = { path = "../ra_prof" } test_utils = { path = "../test_utils" } -ra_hir_def = { path = "../ra_hir_def" } # ra_ide should depend only on the top-level `hir` package. if you need # something from some `hir_xxx` subpackage, reexport the API via `hir`. diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 80c99935d..df56f2d9e 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs @@ -6,7 +6,6 @@ // FIXME: this badly needs rename/rewrite (matklad, 2020-02-06). use hir::{ - db::{DefDatabase, HirDatabase}, Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution, Semantics, TypeParam, Visibility, }; @@ -17,7 +16,6 @@ use ra_syntax::{ }; use crate::RootDatabase; -use ra_hir_def::resolver::{HasResolver, Resolver}; // FIXME: a more precise name would probably be `Symbol`? #[derive(Debug, PartialEq, Eq, Copy, Clone)] @@ -78,21 +76,6 @@ impl Definition { }; Some(name) } - - pub fn resolver(&self, db: &D) -> Option { - use hir::VariantDef; - use ra_hir_def::*; - Some(match self { - Definition::ModuleDef(def) => def.resolver(db)?, - Definition::Field(field) => { - Into::::into(Into::::into(field.parent_def(db))).resolver(db) - } - Definition::Macro(m) => Into::::into(m.module(db)?).resolver(db), - Definition::SelfType(imp) => Into::::into(imp.clone()).resolver(db), - Definition::Local(local) => Into::::into(local.parent(db)).resolver(db), - Definition::TypeParam(tp) => Into::::into(tp.module(db)).resolver(db), - }) - } } #[derive(Debug)] -- cgit v1.2.3