diff options
Diffstat (limited to 'crates/ra_ide_api/src/display/navigation_target.rs')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index b30ef8e05..50accafd0 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -86,9 +86,9 @@ impl NavigationTarget { | |||
86 | name, | 86 | name, |
87 | None, | 87 | None, |
88 | frange.range, | 88 | frange.range, |
89 | src.ast.syntax().kind(), | 89 | src.value.syntax().kind(), |
90 | src.ast.doc_comment_text(), | 90 | src.value.doc_comment_text(), |
91 | src.ast.short_label(), | 91 | src.value.short_label(), |
92 | ); | 92 | ); |
93 | } | 93 | } |
94 | module.to_nav(db) | 94 | module.to_nav(db) |
@@ -146,9 +146,9 @@ impl NavigationTarget { | |||
146 | description: Option<String>, | 146 | description: Option<String>, |
147 | ) -> NavigationTarget { | 147 | ) -> NavigationTarget { |
148 | //FIXME: use `_` instead of empty string | 148 | //FIXME: use `_` instead of empty string |
149 | let name = node.ast.name().map(|it| it.text().clone()).unwrap_or_default(); | 149 | let name = node.value.name().map(|it| it.text().clone()).unwrap_or_default(); |
150 | let focus_range = | 150 | let focus_range = |
151 | node.ast.name().map(|it| original_range(db, node.with_ast(it.syntax())).range); | 151 | node.value.name().map(|it| original_range(db, node.with_ast(it.syntax())).range); |
152 | let frange = original_range(db, node.map(|it| it.syntax())); | 152 | let frange = original_range(db, node.map(|it| it.syntax())); |
153 | 153 | ||
154 | NavigationTarget::from_syntax( | 154 | NavigationTarget::from_syntax( |
@@ -156,7 +156,7 @@ impl NavigationTarget { | |||
156 | name, | 156 | name, |
157 | focus_range, | 157 | focus_range, |
158 | frange.range, | 158 | frange.range, |
159 | node.ast.syntax().kind(), | 159 | node.value.syntax().kind(), |
160 | docs, | 160 | docs, |
161 | description, | 161 | description, |
162 | ) | 162 | ) |
@@ -220,8 +220,8 @@ where | |||
220 | NavigationTarget::from_named( | 220 | NavigationTarget::from_named( |
221 | db, | 221 | db, |
222 | src.as_ref().map(|it| it as &dyn ast::NameOwner), | 222 | src.as_ref().map(|it| it as &dyn ast::NameOwner), |
223 | src.ast.doc_comment_text(), | 223 | src.value.doc_comment_text(), |
224 | src.ast.short_label(), | 224 | src.value.short_label(), |
225 | ) | 225 | ) |
226 | } | 226 | } |
227 | } | 227 | } |
@@ -230,7 +230,7 @@ impl ToNav for hir::Module { | |||
230 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { | 230 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { |
231 | let src = self.definition_source(db); | 231 | let src = self.definition_source(db); |
232 | let name = self.name(db).map(|it| it.to_string().into()).unwrap_or_default(); | 232 | let name = self.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
233 | match &src.ast { | 233 | match &src.value { |
234 | ModuleSource::SourceFile(node) => { | 234 | ModuleSource::SourceFile(node) => { |
235 | let frange = original_range(db, src.with_ast(node.syntax())); | 235 | let frange = original_range(db, src.with_ast(node.syntax())); |
236 | 236 | ||
@@ -271,7 +271,7 @@ impl ToNav for hir::ImplBlock { | |||
271 | "impl".into(), | 271 | "impl".into(), |
272 | None, | 272 | None, |
273 | frange.range, | 273 | frange.range, |
274 | src.ast.syntax().kind(), | 274 | src.value.syntax().kind(), |
275 | None, | 275 | None, |
276 | None, | 276 | None, |
277 | ) | 277 | ) |
@@ -282,7 +282,7 @@ impl ToNav for hir::StructField { | |||
282 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { | 282 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { |
283 | let src = self.source(db); | 283 | let src = self.source(db); |
284 | 284 | ||
285 | match &src.ast { | 285 | match &src.value { |
286 | FieldSource::Named(it) => NavigationTarget::from_named( | 286 | FieldSource::Named(it) => NavigationTarget::from_named( |
287 | db, | 287 | db, |
288 | src.with_ast(it), | 288 | src.with_ast(it), |
@@ -308,11 +308,11 @@ impl ToNav for hir::StructField { | |||
308 | impl ToNav for hir::MacroDef { | 308 | impl ToNav for hir::MacroDef { |
309 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { | 309 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { |
310 | let src = self.source(db); | 310 | let src = self.source(db); |
311 | log::debug!("nav target {:#?}", src.ast.syntax()); | 311 | log::debug!("nav target {:#?}", src.value.syntax()); |
312 | NavigationTarget::from_named( | 312 | NavigationTarget::from_named( |
313 | db, | 313 | db, |
314 | src.as_ref().map(|it| it as &dyn ast::NameOwner), | 314 | src.as_ref().map(|it| it as &dyn ast::NameOwner), |
315 | src.ast.doc_comment_text(), | 315 | src.value.doc_comment_text(), |
316 | None, | 316 | None, |
317 | ) | 317 | ) |
318 | } | 318 | } |
@@ -341,7 +341,7 @@ impl ToNav for hir::AssocItem { | |||
341 | impl ToNav for hir::Local { | 341 | impl ToNav for hir::Local { |
342 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { | 342 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { |
343 | let src = self.source(db); | 343 | let src = self.source(db); |
344 | let (full_range, focus_range) = match src.ast { | 344 | let (full_range, focus_range) = match src.value { |
345 | Either::A(it) => { | 345 | Either::A(it) => { |
346 | (it.syntax().text_range(), it.name().map(|it| it.syntax().text_range())) | 346 | (it.syntax().text_range(), it.name().map(|it| it.syntax().text_range())) |
347 | } | 347 | } |