diff options
author | Aleksey Kladov <[email protected]> | 2019-07-04 21:05:17 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-07-04 21:09:09 +0100 |
commit | 1834bae5b86c54ed9dece26e82436919d59e6cb7 (patch) | |
tree | 92c8b984e874b67fa1831613464bbe356c1af3dd /crates/ra_ide_api/src/hover.rs | |
parent | 2b2cd829b0f95aef338227deb05ec7503dae9b6c (diff) |
allow rustfmt to reorder imports
This wasn't a right decision in the first place, the feature flag was
broken in the last rustfmt release, and syntax highlighting of imports
is more important anyway
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index df877c324..1edeb7579 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -1,16 +1,22 @@ | |||
1 | use hir::{HasSource, HirDisplay}; | ||
1 | use ra_db::SourceDatabase; | 2 | use ra_db::SourceDatabase; |
2 | use ra_syntax::{ | 3 | use ra_syntax::{ |
3 | AstNode, TreeArc, | 4 | algo::{ |
5 | ancestors_at_offset, find_covering_element, find_node_at_offset, | ||
6 | visit::{visitor, Visitor}, | ||
7 | }, | ||
4 | ast::{self, DocCommentsOwner}, | 8 | ast::{self, DocCommentsOwner}, |
5 | algo::{find_covering_element, find_node_at_offset, ancestors_at_offset, visit::{visitor, Visitor}}, | 9 | AstNode, TreeArc, |
6 | }; | 10 | }; |
7 | use hir::{HirDisplay, HasSource}; | ||
8 | 11 | ||
9 | use crate::{ | 12 | use crate::{ |
10 | db::RootDatabase, | 13 | db::RootDatabase, |
11 | RangeInfo, FilePosition, FileRange, | 14 | display::{ |
12 | display::{rust_code_markup, rust_code_markup_with_doc, ShortLabel, docs_from_symbol, description_from_symbol}, | 15 | description_from_symbol, docs_from_symbol, rust_code_markup, rust_code_markup_with_doc, |
13 | name_ref_kind::{NameRefKind::*, classify_name_ref}, | 16 | ShortLabel, |
17 | }, | ||
18 | name_ref_kind::{classify_name_ref, NameRefKind::*}, | ||
19 | FilePosition, FileRange, RangeInfo, | ||
14 | }; | 20 | }; |
15 | 21 | ||
16 | /// Contains the results when hovering over an item | 22 | /// Contains the results when hovering over an item |
@@ -256,8 +262,10 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> { | |||
256 | 262 | ||
257 | #[cfg(test)] | 263 | #[cfg(test)] |
258 | mod tests { | 264 | mod tests { |
265 | use crate::mock_analysis::{ | ||
266 | analysis_and_position, single_file_with_position, single_file_with_range, | ||
267 | }; | ||
259 | use ra_syntax::TextRange; | 268 | use ra_syntax::TextRange; |
260 | use crate::mock_analysis::{single_file_with_position, single_file_with_range, analysis_and_position}; | ||
261 | 269 | ||
262 | fn trim_markup(s: &str) -> &str { | 270 | fn trim_markup(s: &str) -> &str { |
263 | s.trim_start_matches("```rust\n").trim_end_matches("\n```") | 271 | s.trim_start_matches("```rust\n").trim_end_matches("\n```") |