diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_dot.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/goto_type_definition.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide_api/src/line_index.rs | 2 |
4 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index 0822a0e7e..f26fd06b3 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs | |||
@@ -15,7 +15,7 @@ pub(super) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { | |||
15 | } | 15 | } |
16 | 16 | ||
17 | fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { | 17 | fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { |
18 | for receiver in receiver.autoderef(ctx.db) { | 18 | for receiver in ctx.analyzer.autoderef(ctx.db, receiver) { |
19 | if let Ty::Apply(a_ty) = receiver { | 19 | if let Ty::Apply(a_ty) = receiver { |
20 | match a_ty.ctor { | 20 | match a_ty.ctor { |
21 | TypeCtor::Adt(AdtDef::Struct(s)) => { | 21 | TypeCtor::Adt(AdtDef::Struct(s)) => { |
diff --git a/crates/ra_ide_api/src/goto_type_definition.rs b/crates/ra_ide_api/src/goto_type_definition.rs index 0f638b170..6f5164e0b 100644 --- a/crates/ra_ide_api/src/goto_type_definition.rs +++ b/crates/ra_ide_api/src/goto_type_definition.rs | |||
@@ -30,7 +30,7 @@ pub(crate) fn goto_type_definition( | |||
30 | return None; | 30 | return None; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | let adt_def = ty.autoderef(db).find_map(|ty| ty.as_adt().map(|adt| adt.0))?; | 33 | let adt_def = analyzer.autoderef(db, ty).find_map(|ty| ty.as_adt().map(|adt| adt.0))?; |
34 | 34 | ||
35 | let nav = NavigationTarget::from_adt_def(db, adt_def); | 35 | let nav = NavigationTarget::from_adt_def(db, adt_def); |
36 | Some(RangeInfo::new(node.range(), vec![nav])) | 36 | Some(RangeInfo::new(node.range(), vec![nav])) |
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 8741e736f..e61d5627e 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -276,6 +276,9 @@ impl AnalysisHost { | |||
276 | pub fn collect_garbage(&mut self) { | 276 | pub fn collect_garbage(&mut self) { |
277 | self.db.collect_garbage(); | 277 | self.db.collect_garbage(); |
278 | } | 278 | } |
279 | pub fn raw_database(&self) -> &(impl hir::db::HirDatabase + salsa::Database) { | ||
280 | &self.db | ||
281 | } | ||
279 | } | 282 | } |
280 | 283 | ||
281 | /// Analysis is a snapshot of a world state at a moment in time. It is the main | 284 | /// Analysis is a snapshot of a world state at a moment in time. It is the main |
diff --git a/crates/ra_ide_api/src/line_index.rs b/crates/ra_ide_api/src/line_index.rs index 087dfafed..a53cf9ee0 100644 --- a/crates/ra_ide_api/src/line_index.rs +++ b/crates/ra_ide_api/src/line_index.rs | |||
@@ -10,7 +10,9 @@ pub struct LineIndex { | |||
10 | 10 | ||
11 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | 11 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
12 | pub struct LineCol { | 12 | pub struct LineCol { |
13 | /// Zero-based | ||
13 | pub line: u32, | 14 | pub line: u32, |
15 | /// Zero-based | ||
14 | pub col_utf16: u32, | 16 | pub col_utf16: u32, |
15 | } | 17 | } |
16 | 18 | ||