diff options
author | Aleksey Kladov <[email protected]> | 2020-07-08 18:58:50 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-08 19:35:54 +0100 |
commit | d74a77efb19c5f3c45a09bd8ccd5b50d453927d1 (patch) | |
tree | 74342e348658cb857b18a2a0d4f319c17efbdf14 | |
parent | 7238acab787328e5c1bf9beada140173f34efae0 (diff) |
Minimize API
-rw-r--r-- | crates/ra_ide/src/hover.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 96b564a96..98be22339 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -96,9 +96,6 @@ impl HoverResult { | |||
96 | self.results.join("\n\n___\n") | 96 | self.results.join("\n\n___\n") |
97 | } | 97 | } |
98 | 98 | ||
99 | fn extend(&mut self, item: Option<String>) { | ||
100 | self.results.extend(item); | ||
101 | } | ||
102 | fn push_action(&mut self, action: HoverAction) { | 99 | fn push_action(&mut self, action: HoverAction) { |
103 | self.actions.push(action); | 100 | self.actions.push(action); |
104 | } | 101 | } |
@@ -128,8 +125,9 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
128 | } | 125 | } |
129 | } { | 126 | } { |
130 | let range = sema.original_range(&node).range; | 127 | let range = sema.original_range(&node).range; |
131 | res.extend(hover_text_from_name_kind(db, name_kind)); | 128 | if let Some(text) = hover_text_from_name_kind(db, name_kind) { |
132 | 129 | res.results.push(text); | |
130 | } | ||
133 | if !res.is_empty() { | 131 | if !res.is_empty() { |
134 | if let Some(action) = show_implementations_action(db, name_kind) { | 132 | if let Some(action) = show_implementations_action(db, name_kind) { |
135 | res.push_action(action); | 133 | res.push_action(action); |
@@ -168,7 +166,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
168 | } | 166 | } |
169 | }?; | 167 | }?; |
170 | 168 | ||
171 | res.extend(Some(rust_code_markup(&ty.display(db)))); | 169 | res.results.push(rust_code_markup(&ty.display(db))); |
172 | let range = sema.original_range(&node).range; | 170 | let range = sema.original_range(&node).range; |
173 | Some(RangeInfo::new(range, res)) | 171 | Some(RangeInfo::new(range, res)) |
174 | } | 172 | } |