diff options
author | Aleksey Kladov <[email protected]> | 2018-10-20 20:38:47 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-20 20:38:52 +0100 |
commit | 6e88aaef5d49c8ec7b6ffe6b41457c3a028b4eb0 (patch) | |
tree | 6ae9f95315451a9e722dcffa0c1e1283d276d312 /crates | |
parent | 8eea10e3ab25111375a95990b93d1170d5fe8a9f (diff) |
use pythonic import order
use std
// blank line
use extern crates
// blank line
use crate::{}
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/descriptors.rs | 5 | ||||
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 3 | ||||
-rw-r--r-- | crates/ra_analysis/src/symbol_index.rs | 11 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 5 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/path_map.rs | 4 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/project_model.rs | 4 | ||||
-rw-r--r-- | 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 @@ | |||
1 | use crate::{imp::FileResolverImp, FileId}; | 1 | use std::collections::BTreeMap; |
2 | |||
2 | use ra_syntax::{ | 3 | use ra_syntax::{ |
3 | ast::{self, AstNode, NameOwner}, | 4 | ast::{self, AstNode, NameOwner}, |
4 | text_utils::is_subrange, | 5 | text_utils::is_subrange, |
@@ -6,7 +7,7 @@ use ra_syntax::{ | |||
6 | }; | 7 | }; |
7 | use relative_path::RelativePathBuf; | 8 | use relative_path::RelativePathBuf; |
8 | 9 | ||
9 | use std::collections::BTreeMap; | 10 | use crate::{imp::FileResolverImp, FileId}; |
10 | 11 | ||
11 | #[derive(Debug, PartialEq, Eq, Hash)] | 12 | #[derive(Debug, PartialEq, Eq, Hash)] |
12 | pub struct ModuleDescriptor { | 13 | 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; | |||
23 | 23 | ||
24 | use std::{fmt::Debug, sync::Arc}; | 24 | use std::{fmt::Debug, sync::Arc}; |
25 | 25 | ||
26 | use crate::imp::{AnalysisHostImpl, AnalysisImpl, FileResolverImp}; | ||
27 | use ra_syntax::{AtomEdit, File, TextRange, TextUnit}; | 26 | use ra_syntax::{AtomEdit, File, TextRange, TextUnit}; |
28 | use relative_path::{RelativePath, RelativePathBuf}; | 27 | use relative_path::{RelativePath, RelativePathBuf}; |
29 | use rustc_hash::FxHashMap; | 28 | use rustc_hash::FxHashMap; |
30 | 29 | ||
30 | use crate::imp::{AnalysisHostImpl, AnalysisImpl, FileResolverImp}; | ||
31 | |||
31 | pub use crate::{ | 32 | pub use crate::{ |
32 | descriptors::FnDescriptor, | 33 | descriptors::FnDescriptor, |
33 | job::{JobHandle, JobToken}, | 34 | 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 @@ | |||
1 | use crate::{FileId, Query}; | 1 | use std::{ |
2 | hash::{Hash, Hasher}, | ||
3 | sync::Arc, | ||
4 | }; | ||
5 | |||
2 | use fst::{self, Streamer}; | 6 | use fst::{self, Streamer}; |
3 | use ra_editor::{file_symbols, FileSymbol}; | 7 | use ra_editor::{file_symbols, FileSymbol}; |
4 | use ra_syntax::{ | 8 | use ra_syntax::{ |
@@ -7,10 +11,7 @@ use ra_syntax::{ | |||
7 | }; | 11 | }; |
8 | use rayon::prelude::*; | 12 | use rayon::prelude::*; |
9 | 13 | ||
10 | use std::{ | 14 | use crate::{FileId, Query}; |
11 | hash::{Hash, Hasher}, | ||
12 | sync::Arc, | ||
13 | }; | ||
14 | 15 | ||
15 | #[derive(Debug)] | 16 | #[derive(Debug)] |
16 | pub(crate) struct SymbolIndex { | 17 | 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 @@ | |||
1 | use rustc_hash::FxHashMap; | 1 | use std::collections::HashMap; |
2 | 2 | ||
3 | use rustc_hash::FxHashMap; | ||
3 | use languageserver_types::{ | 4 | use languageserver_types::{ |
4 | CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, | 5 | CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, |
5 | DiagnosticSeverity, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, | 6 | DiagnosticSeverity, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, |
@@ -18,8 +19,6 @@ use crate::{ | |||
18 | Result, | 19 | Result, |
19 | }; | 20 | }; |
20 | 21 | ||
21 | use std::collections::HashMap; | ||
22 | |||
23 | pub fn handle_syntax_tree( | 22 | pub fn handle_syntax_tree( |
24 | world: ServerWorld, | 23 | world: ServerWorld, |
25 | params: req::SyntaxTreeParams, | 24 | 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 @@ | |||
1 | use std::path::{Component, Path, PathBuf}; | ||
2 | |||
1 | use im; | 3 | use im; |
2 | use ra_analysis::{FileId, FileResolver}; | 4 | use ra_analysis::{FileId, FileResolver}; |
3 | use relative_path::RelativePath; | 5 | use relative_path::RelativePath; |
4 | 6 | ||
5 | use std::path::{Component, Path, PathBuf}; | ||
6 | |||
7 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 7 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
8 | pub enum Root { | 8 | pub enum Root { |
9 | Workspace, | 9 | 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 @@ | |||
1 | use std::path::{Path, PathBuf}; | ||
2 | |||
1 | use cargo_metadata::{metadata_run, CargoOpt}; | 3 | use cargo_metadata::{metadata_run, CargoOpt}; |
2 | use ra_syntax::SmolStr; | 4 | use ra_syntax::SmolStr; |
3 | use rustc_hash::{FxHashMap, FxHashSet}; | 5 | use rustc_hash::{FxHashMap, FxHashSet}; |
4 | 6 | ||
5 | use std::path::{Path, PathBuf}; | ||
6 | |||
7 | use crate::{ | 7 | use crate::{ |
8 | thread_watcher::{ThreadWatcher, Worker}, | 8 | thread_watcher::{ThreadWatcher, Worker}, |
9 | Result, | 9 | 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 @@ | |||
1 | use crate::Result; | 1 | use std::thread; |
2 | |||
2 | use crossbeam_channel::{bounded, unbounded, Receiver, Sender}; | 3 | use crossbeam_channel::{bounded, unbounded, Receiver, Sender}; |
3 | use drop_bomb::DropBomb; | 4 | use drop_bomb::DropBomb; |
4 | 5 | ||
5 | use std::thread; | 6 | use crate::Result; |
6 | 7 | ||
7 | pub struct Worker<I, O> { | 8 | pub struct Worker<I, O> { |
8 | pub inp: Sender<I>, | 9 | pub inp: Sender<I>, |