diff options
author | Aleksey Kladov <[email protected]> | 2019-01-02 20:35:51 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-03 09:26:40 +0000 |
commit | 03ea6bcbffd4ae3ac5289ff7d434450c219186a8 (patch) | |
tree | 882401790c66b34e447c31920eb7e6e3c11efc4f /crates/ra_analysis/src | |
parent | 267a89bca2b606faafacfe69db7fda1ef27bb39f (diff) |
use LocalPtr in navigation target
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 3 | ||||
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 7604c7def..b812c3441 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -121,6 +121,7 @@ impl db::RootDatabase { | |||
121 | name: decl_name.text(), | 121 | name: decl_name.text(), |
122 | range: decl_name.syntax().range(), | 122 | range: decl_name.syntax().range(), |
123 | kind: MODULE, | 123 | kind: MODULE, |
124 | ptr: None, | ||
124 | }]) | 125 | }]) |
125 | } | 126 | } |
126 | /// Returns `Vec` for the same reason as `parent_module` | 127 | /// Returns `Vec` for the same reason as `parent_module` |
@@ -158,6 +159,7 @@ impl db::RootDatabase { | |||
158 | name: entry.name().to_string().into(), | 159 | name: entry.name().to_string().into(), |
159 | range: entry.ptr().range(), | 160 | range: entry.ptr().range(), |
160 | kind: NAME, | 161 | kind: NAME, |
162 | ptr: None, | ||
161 | }); | 163 | }); |
162 | return Ok(Some(rr)); | 164 | return Ok(Some(rr)); |
163 | }; | 165 | }; |
@@ -185,6 +187,7 @@ impl db::RootDatabase { | |||
185 | name, | 187 | name, |
186 | range: TextRange::offset_len(0.into(), 0.into()), | 188 | range: TextRange::offset_len(0.into(), 0.into()), |
187 | kind: MODULE, | 189 | kind: MODULE, |
190 | ptr: None, | ||
188 | }; | 191 | }; |
189 | rr.resolves_to.push(symbol); | 192 | rr.resolves_to.push(symbol); |
190 | return Ok(Some(rr)); | 193 | return Ok(Some(rr)); |
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 69d6754d6..343fd28bb 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -41,7 +41,7 @@ pub use ra_editor::{ | |||
41 | pub use hir::FnSignatureInfo; | 41 | pub use hir::FnSignatureInfo; |
42 | 42 | ||
43 | pub use ra_db::{ | 43 | pub use ra_db::{ |
44 | Canceled, Cancelable, FilePosition, FileRange, | 44 | Canceled, Cancelable, FilePosition, FileRange, LocalSyntaxPtr, |
45 | CrateGraph, CrateId, SourceRootId, FileId, SyntaxDatabase, FilesDatabase | 45 | CrateGraph, CrateId, SourceRootId, FileId, SyntaxDatabase, FilesDatabase |
46 | }; | 46 | }; |
47 | 47 | ||
@@ -225,6 +225,8 @@ pub struct NavigationTarget { | |||
225 | name: SmolStr, | 225 | name: SmolStr, |
226 | kind: SyntaxKind, | 226 | kind: SyntaxKind, |
227 | range: TextRange, | 227 | range: TextRange, |
228 | // Should be DefId ideally | ||
229 | ptr: Option<LocalSyntaxPtr>, | ||
228 | } | 230 | } |
229 | 231 | ||
230 | impl NavigationTarget { | 232 | impl NavigationTarget { |
@@ -234,6 +236,7 @@ impl NavigationTarget { | |||
234 | kind: symbol.ptr.kind(), | 236 | kind: symbol.ptr.kind(), |
235 | file_id, | 237 | file_id, |
236 | range: symbol.ptr.range(), | 238 | range: symbol.ptr.range(), |
239 | ptr: Some(symbol.ptr.clone()), | ||
237 | } | 240 | } |
238 | } | 241 | } |
239 | pub fn name(&self) -> &SmolStr { | 242 | pub fn name(&self) -> &SmolStr { |