diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/ra_ide_api/src/change.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 8 | ||||
-rw-r--r-- | crates/ra_ide_api/src/db.rs | 5 | ||||
-rw-r--r-- | crates/ra_ide_api/src/diagnostics.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide_api/src/mock_analysis.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/references/rename.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide_api/src/source_change.rs | 2 |
8 files changed, 12 insertions, 16 deletions
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" | |||
12 | itertools = "0.8.0" | 12 | itertools = "0.8.0" |
13 | join_to_string = "0.1.3" | 13 | join_to_string = "0.1.3" |
14 | log = "0.4.5" | 14 | log = "0.4.5" |
15 | relative-path = "1.0.0" | ||
16 | rayon = "1.0.2" | 15 | rayon = "1.0.2" |
17 | fst = { version = "0.3.1", default-features = false } | 16 | fst = { version = "0.3.1", default-features = false } |
18 | rustc-hash = "1.0" | 17 | 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}; | |||
4 | 4 | ||
5 | use ra_db::{ | 5 | use ra_db::{ |
6 | salsa::{Database, Durability, SweepStrategy}, | 6 | salsa::{Database, Durability, SweepStrategy}, |
7 | CrateGraph, CrateId, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId, | 7 | CrateGraph, CrateId, FileId, RelativePathBuf, SourceDatabase, SourceDatabaseExt, SourceRoot, |
8 | SourceRootId, | ||
8 | }; | 9 | }; |
9 | use ra_prof::{memory_usage, profile, Bytes}; | 10 | use ra_prof::{memory_usage, profile, Bytes}; |
10 | use ra_syntax::SourceFile; | 11 | use ra_syntax::SourceFile; |
11 | #[cfg(not(feature = "wasm"))] | 12 | #[cfg(not(feature = "wasm"))] |
12 | use rayon::prelude::*; | 13 | use rayon::prelude::*; |
13 | use relative_path::RelativePathBuf; | ||
14 | use rustc_hash::FxHashMap; | 14 | use rustc_hash::FxHashMap; |
15 | 15 | ||
16 | use crate::{ | 16 | use crate::{ |
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 9ac9768af..09ca40179 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -18,15 +18,15 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
18 | match def { | 18 | match def { |
19 | hir::ModuleDef::Module(module) => { | 19 | hir::ModuleDef::Module(module) => { |
20 | let module_scope = module.scope(ctx.db); | 20 | let module_scope = module.scope(ctx.db); |
21 | for (name, res) in module_scope.entries() { | 21 | for (name, def, import) in module_scope { |
22 | if let Some(hir::ModuleDef::BuiltinType(..)) = res.def.take_types() { | 22 | if let hir::ScopeDef::ModuleDef(hir::ModuleDef::BuiltinType(..)) = def { |
23 | if ctx.use_item_syntax.is_some() { | 23 | if ctx.use_item_syntax.is_some() { |
24 | tested_by!(dont_complete_primitive_in_use); | 24 | tested_by!(dont_complete_primitive_in_use); |
25 | continue; | 25 | continue; |
26 | } | 26 | } |
27 | } | 27 | } |
28 | if Some(module) == ctx.module { | 28 | if Some(module) == ctx.module { |
29 | if let Some(import) = res.import { | 29 | if let Some(import) = import { |
30 | if let Either::A(use_tree) = module.import_source(ctx.db, import) { | 30 | if let Either::A(use_tree) = module.import_source(ctx.db, import) { |
31 | if use_tree.syntax().text_range().contains_inclusive(ctx.offset) { | 31 | if use_tree.syntax().text_range().contains_inclusive(ctx.offset) { |
32 | // for `use self::foo<|>`, don't suggest `foo` as a completion | 32 | // for `use self::foo<|>`, don't suggest `foo` as a completion |
@@ -36,7 +36,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
36 | } | 36 | } |
37 | } | 37 | } |
38 | } | 38 | } |
39 | acc.add_resolution(ctx, name.to_string(), &res.def.into()); | 39 | acc.add_resolution(ctx, name.to_string(), &def); |
40 | } | 40 | } |
41 | } | 41 | } |
42 | hir::ModuleDef::Adt(_) | hir::ModuleDef::TypeAlias(_) => { | 42 | hir::ModuleDef::Adt(_) | hir::ModuleDef::TypeAlias(_) => { |
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; | |||
4 | 4 | ||
5 | use ra_db::{ | 5 | use ra_db::{ |
6 | salsa::{self, Database, Durability}, | 6 | salsa::{self, Database, Durability}, |
7 | Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, | 7 | Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, RelativePath, |
8 | SourceDatabaseExt, SourceRootId, | 8 | SourceDatabase, SourceDatabaseExt, SourceRootId, |
9 | }; | 9 | }; |
10 | use relative_path::RelativePath; | ||
11 | use rustc_hash::FxHashMap; | 10 | use rustc_hash::FxHashMap; |
12 | 11 | ||
13 | use crate::{ | 12 | 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; | |||
4 | 4 | ||
5 | use hir::diagnostics::{AstDiagnostic, Diagnostic as _, DiagnosticSink}; | 5 | use hir::diagnostics::{AstDiagnostic, Diagnostic as _, DiagnosticSink}; |
6 | use itertools::Itertools; | 6 | use itertools::Itertools; |
7 | use ra_db::{SourceDatabase, SourceDatabaseExt}; | 7 | use ra_db::{RelativePath, SourceDatabase, SourceDatabaseExt}; |
8 | use ra_prof::profile; | 8 | use ra_prof::profile; |
9 | use ra_syntax::{ | 9 | use ra_syntax::{ |
10 | algo, | 10 | algo, |
@@ -12,7 +12,6 @@ use ra_syntax::{ | |||
12 | Location, SyntaxNode, TextRange, T, | 12 | Location, SyntaxNode, TextRange, T, |
13 | }; | 13 | }; |
14 | use ra_text_edit::{TextEdit, TextEditBuilder}; | 14 | use ra_text_edit::{TextEdit, TextEditBuilder}; |
15 | use relative_path::RelativePath; | ||
16 | 15 | ||
17 | use crate::{db::RootDatabase, Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit}; | 16 | use crate::{db::RootDatabase, Diagnostic, FileId, FileSystemEdit, SourceChange, SourceFileEdit}; |
18 | 17 | ||
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 @@ | |||
3 | use std::sync::Arc; | 3 | use std::sync::Arc; |
4 | 4 | ||
5 | use ra_cfg::CfgOptions; | 5 | use ra_cfg::CfgOptions; |
6 | use relative_path::RelativePathBuf; | 6 | use ra_db::RelativePathBuf; |
7 | use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; | 7 | use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; |
8 | 8 | ||
9 | use crate::{ | 9 | 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 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir::ModuleSource; | 3 | use hir::ModuleSource; |
4 | use ra_db::{SourceDatabase, SourceDatabaseExt}; | 4 | use ra_db::{RelativePath, RelativePathBuf, SourceDatabase, SourceDatabaseExt}; |
5 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNode}; | 5 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNode}; |
6 | use ra_text_edit::TextEdit; | 6 | use ra_text_edit::TextEdit; |
7 | use relative_path::{RelativePath, RelativePathBuf}; | ||
8 | 7 | ||
9 | use crate::{ | 8 | use crate::{ |
10 | db::RootDatabase, FileId, FilePosition, FileSystemEdit, RangeInfo, SourceChange, | 9 | 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 @@ | |||
3 | //! | 3 | //! |
4 | //! It can be viewed as a dual for `AnalysisChange`. | 4 | //! It can be viewed as a dual for `AnalysisChange`. |
5 | 5 | ||
6 | use ra_db::RelativePathBuf; | ||
6 | use ra_text_edit::TextEdit; | 7 | use ra_text_edit::TextEdit; |
7 | use relative_path::RelativePathBuf; | ||
8 | 8 | ||
9 | use crate::{FileId, FilePosition, SourceRootId, TextUnit}; | 9 | use crate::{FileId, FilePosition, SourceRootId, TextUnit}; |
10 | 10 | ||