From 1834bae5b86c54ed9dece26e82436919d59e6cb7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 4 Jul 2019 23:05:17 +0300 Subject: 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 --- crates/ra_ide_api/src/hover.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'crates/ra_ide_api/src/hover.rs') 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 @@ +use hir::{HasSource, HirDisplay}; use ra_db::SourceDatabase; use ra_syntax::{ - AstNode, TreeArc, + algo::{ + ancestors_at_offset, find_covering_element, find_node_at_offset, + visit::{visitor, Visitor}, + }, ast::{self, DocCommentsOwner}, - algo::{find_covering_element, find_node_at_offset, ancestors_at_offset, visit::{visitor, Visitor}}, + AstNode, TreeArc, }; -use hir::{HirDisplay, HasSource}; use crate::{ db::RootDatabase, - RangeInfo, FilePosition, FileRange, - display::{rust_code_markup, rust_code_markup_with_doc, ShortLabel, docs_from_symbol, description_from_symbol}, - name_ref_kind::{NameRefKind::*, classify_name_ref}, + display::{ + description_from_symbol, docs_from_symbol, rust_code_markup, rust_code_markup_with_doc, + ShortLabel, + }, + name_ref_kind::{classify_name_ref, NameRefKind::*}, + FilePosition, FileRange, RangeInfo, }; /// Contains the results when hovering over an item @@ -256,8 +262,10 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option { #[cfg(test)] mod tests { + use crate::mock_analysis::{ + analysis_and_position, single_file_with_position, single_file_with_range, + }; use ra_syntax::TextRange; - use crate::mock_analysis::{single_file_with_position, single_file_with_range, analysis_and_position}; fn trim_markup(s: &str) -> &str { s.trim_start_matches("```rust\n").trim_end_matches("\n```") -- cgit v1.2.3