aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/display/navigation_target.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/display/navigation_target.rs')
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs46
1 files changed, 23 insertions, 23 deletions
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index fd245705c..fdbf75abd 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -7,7 +7,7 @@ use ra_ide_db::{defs::Definition, RootDatabase};
7use ra_syntax::{ 7use ra_syntax::{
8 ast::{self, DocCommentsOwner, NameOwner}, 8 ast::{self, DocCommentsOwner, NameOwner},
9 match_ast, AstNode, SmolStr, 9 match_ast, AstNode, SmolStr,
10 SyntaxKind::{self, BIND_PAT, TYPE_PARAM}, 10 SyntaxKind::{self, IDENT_PAT, TYPE_PARAM},
11 TextRange, 11 TextRange,
12}; 12};
13 13
@@ -253,7 +253,7 @@ impl ToNav for hir::ImplDef {
253 let focus_range = if derive_attr.is_some() { 253 let focus_range = if derive_attr.is_some() {
254 None 254 None
255 } else { 255 } else {
256 src.value.target_type().map(|ty| original_range(db, src.with_value(ty.syntax())).range) 256 src.value.self_ty().map(|ty| original_range(db, src.with_value(ty.syntax())).range)
257 }; 257 };
258 258
259 NavigationTarget::from_syntax( 259 NavigationTarget::from_syntax(
@@ -339,7 +339,7 @@ impl ToNav for hir::Local {
339 NavigationTarget { 339 NavigationTarget {
340 file_id: full_range.file_id, 340 file_id: full_range.file_id,
341 name, 341 name,
342 kind: BIND_PAT, 342 kind: IDENT_PAT,
343 full_range: full_range.range, 343 full_range: full_range.range,
344 focus_range: None, 344 focus_range: None,
345 container_name: None, 345 container_name: None,
@@ -379,16 +379,16 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option
379 379
380 match_ast! { 380 match_ast! {
381 match node { 381 match node {
382 ast::FnDef(it) => it.doc_comment_text(), 382 ast::Fn(it) => it.doc_comment_text(),
383 ast::StructDef(it) => it.doc_comment_text(), 383 ast::Struct(it) => it.doc_comment_text(),
384 ast::EnumDef(it) => it.doc_comment_text(), 384 ast::Enum(it) => it.doc_comment_text(),
385 ast::TraitDef(it) => it.doc_comment_text(), 385 ast::Trait(it) => it.doc_comment_text(),
386 ast::Module(it) => it.doc_comment_text(), 386 ast::Module(it) => it.doc_comment_text(),
387 ast::TypeAliasDef(it) => it.doc_comment_text(), 387 ast::TypeAlias(it) => it.doc_comment_text(),
388 ast::ConstDef(it) => it.doc_comment_text(), 388 ast::Const(it) => it.doc_comment_text(),
389 ast::StaticDef(it) => it.doc_comment_text(), 389 ast::Static(it) => it.doc_comment_text(),
390 ast::RecordFieldDef(it) => it.doc_comment_text(), 390 ast::RecordField(it) => it.doc_comment_text(),
391 ast::EnumVariant(it) => it.doc_comment_text(), 391 ast::Variant(it) => it.doc_comment_text(),
392 ast::MacroCall(it) => it.doc_comment_text(), 392 ast::MacroCall(it) => it.doc_comment_text(),
393 _ => None, 393 _ => None,
394 } 394 }
@@ -404,16 +404,16 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) ->
404 404
405 match_ast! { 405 match_ast! {
406 match node { 406 match node {
407 ast::FnDef(it) => it.short_label(), 407 ast::Fn(it) => it.short_label(),
408 ast::StructDef(it) => it.short_label(), 408 ast::Struct(it) => it.short_label(),
409 ast::EnumDef(it) => it.short_label(), 409 ast::Enum(it) => it.short_label(),
410 ast::TraitDef(it) => it.short_label(), 410 ast::Trait(it) => it.short_label(),
411 ast::Module(it) => it.short_label(), 411 ast::Module(it) => it.short_label(),
412 ast::TypeAliasDef(it) => it.short_label(), 412 ast::TypeAlias(it) => it.short_label(),
413 ast::ConstDef(it) => it.short_label(), 413 ast::Const(it) => it.short_label(),
414 ast::StaticDef(it) => it.short_label(), 414 ast::Static(it) => it.short_label(),
415 ast::RecordFieldDef(it) => it.short_label(), 415 ast::RecordField(it) => it.short_label(),
416 ast::EnumVariant(it) => it.short_label(), 416 ast::Variant(it) => it.short_label(),
417 _ => None, 417 _ => None,
418 } 418 }
419 } 419 }
@@ -446,7 +446,7 @@ fn foo() { enum FooInner { } }
446 5..13, 446 5..13,
447 ), 447 ),
448 name: "FooInner", 448 name: "FooInner",
449 kind: ENUM_DEF, 449 kind: ENUM,
450 container_name: None, 450 container_name: None,
451 description: Some( 451 description: Some(
452 "enum FooInner", 452 "enum FooInner",
@@ -462,7 +462,7 @@ fn foo() { enum FooInner { } }
462 34..42, 462 34..42,
463 ), 463 ),
464 name: "FooInner", 464 name: "FooInner",
465 kind: ENUM_DEF, 465 kind: ENUM,
466 container_name: Some( 466 container_name: Some(
467 "foo", 467 "foo",
468 ), 468 ),