From 3603d0213480c7b3423345d21243397eb904a073 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 4 Nov 2019 01:14:17 +0300 Subject: Reexport relative_path from ra_db --- crates/ra_db/src/input.rs | 3 ++- crates/ra_hir/Cargo.toml | 1 - crates/ra_hir/src/mock.rs | 3 +-- crates/ra_hir_def/Cargo.toml | 2 -- crates/ra_hir_def/src/diagnostics.rs | 2 +- crates/ra_hir_def/src/nameres.rs | 2 +- crates/ra_hir_def/src/nameres/mod_resolution.rs | 3 +-- crates/ra_hir_def/src/test_db.rs | 3 +-- crates/ra_ide_api/Cargo.toml | 1 - crates/ra_ide_api/src/change.rs | 4 ++-- crates/ra_ide_api/src/db.rs | 5 ++--- crates/ra_ide_api/src/diagnostics.rs | 3 +-- crates/ra_ide_api/src/mock_analysis.rs | 2 +- crates/ra_ide_api/src/references/rename.rs | 3 +-- crates/ra_ide_api/src/source_change.rs | 2 +- 15 files changed, 15 insertions(+), 24 deletions(-) (limited to 'crates') diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 7c8dac1d3..60f7dc881 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs @@ -6,13 +6,14 @@ //! actual IO. See `vfs` and `project_model` in the `ra_lsp_server` crate for how //! actual IO is done and lowered to input. -use relative_path::{RelativePath, RelativePathBuf}; use rustc_hash::FxHashMap; use ra_cfg::CfgOptions; use ra_syntax::SmolStr; use rustc_hash::FxHashSet; +use crate::{RelativePath, RelativePathBuf}; + /// `FileId` is an integer which uniquely identifies a file. File paths are /// messy and system-dependent, so most of the code should work directly with /// `FileId`, without inspecting the path. The mapping between `FileId` and path diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index fae5dc7cb..324961328 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml @@ -7,7 +7,6 @@ authors = ["rust-analyzer developers"] [dependencies] arrayvec = "0.5.1" log = "0.4.5" -relative-path = "1.0.0" rustc-hash = "1.0" parking_lot = "0.9.0" ena = "0.13" diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index 4c89c8d38..8d98f88ce 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs @@ -7,9 +7,8 @@ use parking_lot::Mutex; use ra_cfg::CfgOptions; use ra_db::{ salsa, CrateGraph, CrateId, Edition, FileId, FileLoader, FileLoaderDelegate, FilePosition, - SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId, + RelativePath, RelativePathBuf, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId, }; -use relative_path::{RelativePath, RelativePathBuf}; use rustc_hash::FxHashMap; use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER}; diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml index 15055db64..21262be79 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/ra_hir_def/Cargo.toml @@ -7,7 +7,6 @@ authors = ["rust-analyzer developers"] [dependencies] log = "0.4.5" once_cell = "1.0.1" -relative-path = "1.0.0" rustc-hash = "1.0" ra_arena = { path = "../ra_arena" } @@ -22,4 +21,3 @@ tt = { path = "../ra_tt", package = "ra_tt" } [dev-dependencies] insta = "0.12.0" - diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs index 1c1ccdecb..9843009a5 100644 --- a/crates/ra_hir_def/src/diagnostics.rs +++ b/crates/ra_hir_def/src/diagnostics.rs @@ -3,8 +3,8 @@ use std::any::Any; use hir_expand::diagnostics::Diagnostic; +use ra_db::RelativePathBuf; use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; -use relative_path::RelativePathBuf; use hir_expand::{HirFileId, Source}; diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index fbd4248e6..433bdde48 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs @@ -504,8 +504,8 @@ impl CrateDefMap { mod diagnostics { use hir_expand::diagnostics::DiagnosticSink; + use ra_db::RelativePathBuf; use ra_syntax::{ast, AstPtr}; - use relative_path::RelativePathBuf; use crate::{db::DefDatabase2, diagnostics::UnresolvedModule, nameres::CrateModuleId, AstId}; diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/ra_hir_def/src/nameres/mod_resolution.rs index 7d7e2779a..f6b0b8fb1 100644 --- a/crates/ra_hir_def/src/nameres/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/mod_resolution.rs @@ -1,8 +1,7 @@ //! This module resolves `mod foo;` declaration to file. use hir_expand::name::Name; -use ra_db::FileId; +use ra_db::{FileId, RelativePathBuf}; use ra_syntax::SmolStr; -use relative_path::RelativePathBuf; use crate::{db::DefDatabase2, HirFileId}; diff --git a/crates/ra_hir_def/src/test_db.rs b/crates/ra_hir_def/src/test_db.rs index f91a5b41d..8ee8e40d0 100644 --- a/crates/ra_hir_def/src/test_db.rs +++ b/crates/ra_hir_def/src/test_db.rs @@ -5,8 +5,7 @@ use std::{ sync::{Arc, Mutex}, }; -use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate}; -use relative_path::RelativePath; +use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, RelativePath}; #[salsa::database( ra_db::SourceDatabaseExtStorage, diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml index bf6ef12f3..fa353b5dd 100644 --- a/crates/ra_ide_api/Cargo.toml +++ b/crates/ra_ide_api/Cargo.toml @@ -12,7 +12,6 @@ format-buf = "1.0.0" itertools = "0.8.0" join_to_string = "0.1.3" log = "0.4.5" -relative-path = "1.0.0" rayon = "1.0.2" fst = { version = "0.3.1", default-features = false } rustc-hash = "1.0" diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 39c5946c7..4416421ae 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -4,13 +4,13 @@ use std::{fmt, sync::Arc, time}; use ra_db::{ salsa::{Database, Durability, SweepStrategy}, - CrateGraph, CrateId, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId, + CrateGraph, CrateId, FileId, RelativePathBuf, SourceDatabase, SourceDatabaseExt, SourceRoot, + SourceRootId, }; use ra_prof::{memory_usage, profile, Bytes}; use ra_syntax::SourceFile; #[cfg(not(feature = "wasm"))] use rayon::prelude::*; -use relative_path::RelativePathBuf; use rustc_hash::FxHashMap; use crate::{ diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs index 785e71808..c96465b6a 100644 --- a/crates/ra_ide_api/src/db.rs +++ b/crates/ra_ide_api/src/db.rs @@ -4,10 +4,9 @@ use std::sync::Arc; use ra_db::{ salsa::{self, Database, Durability}, - Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, - SourceDatabaseExt, SourceRootId, + Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, RelativePath, + SourceDatabase, SourceDatabaseExt, SourceRootId, }; -use relative_path::RelativePath; use rustc_hash::FxHashMap; use crate::{ diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs index 1f1f5cd74..2890a3d2b 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide_api/src/diagnostics.rs @@ -4,7 +4,7 @@ use std::cell::RefCell; use hir::diagnostics::{AstDiagnostic, Diagnostic as _, DiagnosticSink}; use itertools::Itertools; -use ra_db::{SourceDatabase, SourceDatabaseExt}; +use ra_db::{RelativePath, SourceDatabase, SourceDatabaseExt}; use ra_prof::profile; use ra_syntax::{ algo, @@ -12,7 +12,6 @@ use ra_syntax::{ Location, SyntaxNode, TextRange, T, }; use ra_text_edit::{TextEdit, TextEditBuilder}; -use relative_path::RelativePath; use crate::{db::RootDatabase, Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit}; diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs index 80b71894c..2b1c96dbf 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide_api/src/mock_analysis.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use ra_cfg::CfgOptions; -use relative_path::RelativePathBuf; +use ra_db::RelativePathBuf; use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; use crate::{ diff --git a/crates/ra_ide_api/src/references/rename.rs b/crates/ra_ide_api/src/references/rename.rs index a8783d7a0..11f81cbb3 100644 --- a/crates/ra_ide_api/src/references/rename.rs +++ b/crates/ra_ide_api/src/references/rename.rs @@ -1,10 +1,9 @@ //! FIXME: write short doc here use hir::ModuleSource; -use ra_db::{SourceDatabase, SourceDatabaseExt}; +use ra_db::{RelativePath, RelativePathBuf, SourceDatabase, SourceDatabaseExt}; use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNode}; use ra_text_edit::TextEdit; -use relative_path::{RelativePath, RelativePathBuf}; use crate::{ db::RootDatabase, FileId, FilePosition, FileSystemEdit, RangeInfo, SourceChange, diff --git a/crates/ra_ide_api/src/source_change.rs b/crates/ra_ide_api/src/source_change.rs index 4e63bbf6f..f5f7f8807 100644 --- a/crates/ra_ide_api/src/source_change.rs +++ b/crates/ra_ide_api/src/source_change.rs @@ -3,8 +3,8 @@ //! //! It can be viewed as a dual for `AnalysisChange`. +use ra_db::RelativePathBuf; use ra_text_edit::TextEdit; -use relative_path::RelativePathBuf; use crate::{FileId, FilePosition, SourceRootId, TextUnit}; -- cgit v1.2.3