From 6e88aaef5d49c8ec7b6ffe6b41457c3a028b4eb0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Oct 2018 22:38:47 +0300 Subject: use pythonic import order use std // blank line use extern crates // blank line use crate::{} --- crates/ra_analysis/src/descriptors.rs | 5 +++-- crates/ra_analysis/src/lib.rs | 3 ++- crates/ra_analysis/src/symbol_index.rs | 11 ++++++----- crates/ra_lsp_server/src/main_loop/handlers.rs | 5 ++--- crates/ra_lsp_server/src/path_map.rs | 4 ++-- crates/ra_lsp_server/src/project_model.rs | 4 ++-- crates/ra_lsp_server/src/thread_watcher.rs | 5 +++-- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/crates/ra_analysis/src/descriptors.rs b/crates/ra_analysis/src/descriptors.rs index 6f26f9935..310bf1585 100644 --- a/crates/ra_analysis/src/descriptors.rs +++ b/crates/ra_analysis/src/descriptors.rs @@ -1,4 +1,5 @@ -use crate::{imp::FileResolverImp, FileId}; +use std::collections::BTreeMap; + use ra_syntax::{ ast::{self, AstNode, NameOwner}, text_utils::is_subrange, @@ -6,7 +7,7 @@ use ra_syntax::{ }; use relative_path::RelativePathBuf; -use std::collections::BTreeMap; +use crate::{imp::FileResolverImp, FileId}; #[derive(Debug, PartialEq, Eq, Hash)] pub struct ModuleDescriptor { diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 03708d450..750031093 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -23,11 +23,12 @@ mod symbol_index; use std::{fmt::Debug, sync::Arc}; -use crate::imp::{AnalysisHostImpl, AnalysisImpl, FileResolverImp}; use ra_syntax::{AtomEdit, File, TextRange, TextUnit}; use relative_path::{RelativePath, RelativePathBuf}; use rustc_hash::FxHashMap; +use crate::imp::{AnalysisHostImpl, AnalysisImpl, FileResolverImp}; + pub use crate::{ descriptors::FnDescriptor, job::{JobHandle, JobToken}, diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs index 19f9ea47d..a0f3c0437 100644 --- a/crates/ra_analysis/src/symbol_index.rs +++ b/crates/ra_analysis/src/symbol_index.rs @@ -1,4 +1,8 @@ -use crate::{FileId, Query}; +use std::{ + hash::{Hash, Hasher}, + sync::Arc, +}; + use fst::{self, Streamer}; use ra_editor::{file_symbols, FileSymbol}; use ra_syntax::{ @@ -7,10 +11,7 @@ use ra_syntax::{ }; use rayon::prelude::*; -use std::{ - hash::{Hash, Hasher}, - sync::Arc, -}; +use crate::{FileId, Query}; #[derive(Debug)] pub(crate) struct SymbolIndex { diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 78a8ccfc5..673f1bf7d 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -1,5 +1,6 @@ -use rustc_hash::FxHashMap; +use std::collections::HashMap; +use rustc_hash::FxHashMap; use languageserver_types::{ CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, DiagnosticSeverity, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, @@ -18,8 +19,6 @@ use crate::{ Result, }; -use std::collections::HashMap; - pub fn handle_syntax_tree( world: ServerWorld, params: req::SyntaxTreeParams, diff --git a/crates/ra_lsp_server/src/path_map.rs b/crates/ra_lsp_server/src/path_map.rs index 585013acd..d32829382 100644 --- a/crates/ra_lsp_server/src/path_map.rs +++ b/crates/ra_lsp_server/src/path_map.rs @@ -1,9 +1,9 @@ +use std::path::{Component, Path, PathBuf}; + use im; use ra_analysis::{FileId, FileResolver}; use relative_path::RelativePath; -use std::path::{Component, Path, PathBuf}; - #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Root { Workspace, diff --git a/crates/ra_lsp_server/src/project_model.rs b/crates/ra_lsp_server/src/project_model.rs index d170ceb73..04e2ef9c8 100644 --- a/crates/ra_lsp_server/src/project_model.rs +++ b/crates/ra_lsp_server/src/project_model.rs @@ -1,9 +1,9 @@ +use std::path::{Path, PathBuf}; + use cargo_metadata::{metadata_run, CargoOpt}; use ra_syntax::SmolStr; use rustc_hash::{FxHashMap, FxHashSet}; -use std::path::{Path, PathBuf}; - use crate::{ thread_watcher::{ThreadWatcher, Worker}, Result, diff --git a/crates/ra_lsp_server/src/thread_watcher.rs b/crates/ra_lsp_server/src/thread_watcher.rs index 67952eb74..51b35fa66 100644 --- a/crates/ra_lsp_server/src/thread_watcher.rs +++ b/crates/ra_lsp_server/src/thread_watcher.rs @@ -1,8 +1,9 @@ -use crate::Result; +use std::thread; + use crossbeam_channel::{bounded, unbounded, Receiver, Sender}; use drop_bomb::DropBomb; -use std::thread; +use crate::Result; pub struct Worker { pub inp: Sender, -- cgit v1.2.3