diff options
author | Dmitry <[email protected]> | 2020-08-09 14:35:51 +0100 |
---|---|---|
committer | Dmitry <[email protected]> | 2020-08-09 14:39:32 +0100 |
commit | 8068302fefc75440b823f4bf1731a5f347d7c767 (patch) | |
tree | 251b967182e79bc82a58c2fb208c688f6152df1f /crates/ra_ide/src/display.rs | |
parent | 1a43a0f63e0008787225abb6fb2baef97b6a39e0 (diff) | |
parent | 8a57afe5a4bfab40072a83f7dc4ca560bf860919 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'crates/ra_ide/src/display.rs')
-rw-r--r-- | crates/ra_ide/src/display.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs index 6d4151dd8..fd42aa435 100644 --- a/crates/ra_ide/src/display.rs +++ b/crates/ra_ide/src/display.rs | |||
@@ -5,7 +5,7 @@ mod navigation_target; | |||
5 | mod short_label; | 5 | mod short_label; |
6 | 6 | ||
7 | use ra_syntax::{ | 7 | use ra_syntax::{ |
8 | ast::{self, AstNode, AttrsOwner, NameOwner, TypeParamsOwner}, | 8 | ast::{self, AstNode, AttrsOwner, GenericParamsOwner, NameOwner}, |
9 | SyntaxKind::{ATTR, COMMENT}, | 9 | SyntaxKind::{ATTR, COMMENT}, |
10 | }; | 10 | }; |
11 | 11 | ||
@@ -16,7 +16,7 @@ pub use navigation_target::NavigationTarget; | |||
16 | pub(crate) use navigation_target::{ToNav, TryToNav}; | 16 | pub(crate) use navigation_target::{ToNav, TryToNav}; |
17 | pub(crate) use short_label::ShortLabel; | 17 | pub(crate) use short_label::ShortLabel; |
18 | 18 | ||
19 | pub(crate) fn function_declaration(node: &ast::FnDef) -> String { | 19 | pub(crate) fn function_declaration(node: &ast::Fn) -> String { |
20 | let mut buf = String::new(); | 20 | let mut buf = String::new(); |
21 | if let Some(vis) = node.visibility() { | 21 | if let Some(vis) = node.visibility() { |
22 | format_to!(buf, "{} ", vis); | 22 | format_to!(buf, "{} ", vis); |
@@ -37,14 +37,14 @@ pub(crate) fn function_declaration(node: &ast::FnDef) -> String { | |||
37 | if let Some(name) = node.name() { | 37 | if let Some(name) = node.name() { |
38 | format_to!(buf, "fn {}", name) | 38 | format_to!(buf, "fn {}", name) |
39 | } | 39 | } |
40 | if let Some(type_params) = node.type_param_list() { | 40 | if let Some(type_params) = node.generic_param_list() { |
41 | format_to!(buf, "{}", type_params); | 41 | format_to!(buf, "{}", type_params); |
42 | } | 42 | } |
43 | if let Some(param_list) = node.param_list() { | 43 | if let Some(param_list) = node.param_list() { |
44 | format_to!(buf, "{}", param_list); | 44 | format_to!(buf, "{}", param_list); |
45 | } | 45 | } |
46 | if let Some(ret_type) = node.ret_type() { | 46 | if let Some(ret_type) = node.ret_type() { |
47 | if ret_type.type_ref().is_some() { | 47 | if ret_type.ty().is_some() { |
48 | format_to!(buf, " {}", ret_type); | 48 | format_to!(buf, " {}", ret_type); |
49 | } | 49 | } |
50 | } | 50 | } |
@@ -54,7 +54,7 @@ pub(crate) fn function_declaration(node: &ast::FnDef) -> String { | |||
54 | buf | 54 | buf |
55 | } | 55 | } |
56 | 56 | ||
57 | pub(crate) fn const_label(node: &ast::ConstDef) -> String { | 57 | pub(crate) fn const_label(node: &ast::Const) -> String { |
58 | let label: String = node | 58 | let label: String = node |
59 | .syntax() | 59 | .syntax() |
60 | .children_with_tokens() | 60 | .children_with_tokens() |
@@ -65,7 +65,7 @@ pub(crate) fn const_label(node: &ast::ConstDef) -> String { | |||
65 | label.trim().to_owned() | 65 | label.trim().to_owned() |
66 | } | 66 | } |
67 | 67 | ||
68 | pub(crate) fn type_label(node: &ast::TypeAliasDef) -> String { | 68 | pub(crate) fn type_label(node: &ast::TypeAlias) -> String { |
69 | let label: String = node | 69 | let label: String = node |
70 | .syntax() | 70 | .syntax() |
71 | .children_with_tokens() | 71 | .children_with_tokens() |