Skip to content

Commit 095188d

Browse files
committed
revert some cleanup of use statements
...in the hopes that it simplifies review. The changes should have probably be codified into `cargo fmt`.
1 parent 159150b commit 095188d

File tree

4 files changed

+54
-48
lines changed

4 files changed

+54
-48
lines changed

helix-term/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ helix-loader = { version = "0.6", path = "../helix-loader" }
3636

3737
anyhow = "1"
3838
once_cell = "1.17"
39+
3940
which = "4.4"
4041

4142
tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] }

helix-term/src/application.rs

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
use arc_swap::{access::Map, ArcSwap};
2+
use futures_util::Stream;
3+
use helix_core::{
4+
diagnostic::{DiagnosticTag, NumberOrString},
5+
path::get_relative_path,
6+
pos_at_coords, syntax, Selection,
7+
};
8+
use serde_json::json;
9+
use tui::backend::Backend;
10+
111
use crate::{
212
args::Args,
313
commands::apply_workspace_edit,
@@ -7,22 +17,7 @@ use crate::{
717
keymap::Keymap,
818
ui::{self, overlay::overlayed},
919
};
10-
use anyhow::{Context, Error};
11-
use arc_swap::{access::Map, ArcSwap};
12-
use crossterm::{
13-
event::{
14-
DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste,
15-
EnableFocusChange, EnableMouseCapture, Event as CrosstermEvent,
16-
},
17-
execute, terminal,
18-
tty::IsTty,
19-
};
20-
use futures_util::Stream;
21-
use helix_core::{
22-
diagnostic::{DiagnosticTag, NumberOrString},
23-
path::get_relative_path,
24-
pos_at_coords, syntax, Selection,
25-
};
20+
2621
use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
2722
use helix_view::{
2823
align_view,
@@ -34,14 +29,23 @@ use helix_view::{
3429
Align, Editor,
3530
};
3631
use log::{debug, error, warn};
37-
use serde_json::json;
3832
use std::{
3933
io::{stdin, stdout, Write},
4034
sync::Arc,
4135
time::{Duration, Instant},
4236
};
43-
use tui::backend::Backend;
4437

38+
39+
use anyhow::{Context, Error};
40+
41+
use crossterm::{
42+
event::{
43+
DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste,
44+
EnableFocusChange, EnableMouseCapture, Event as CrosstermEvent,
45+
},
46+
execute, terminal,
47+
tty::IsTty,
48+
};
4549
#[cfg(not(windows))]
4650
use {
4751
signal_hook::{consts::signal, low_level},

helix-term/src/commands.rs

+29-29
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,10 @@ pub(crate) mod lsp;
33
pub(crate) mod typed;
44

55
pub use dap::*;
6+
use helix_vcs::Hunk;
67
pub use lsp::*;
78
pub use typed::*;
89

9-
use crate::{
10-
args,
11-
commands::insert::*,
12-
compositor::{self, Component, Compositor},
13-
filter_picker_entry,
14-
job::{self, Callback, Jobs},
15-
keymap::CommandList,
16-
ui::{
17-
self,
18-
menu::{Cell, Row},
19-
overlay::overlayed,
20-
FilePicker, Picker, Popup, Prompt, PromptEvent,
21-
},
22-
};
23-
24-
use anyhow::{anyhow, bail, ensure, Context as _};
25-
use futures_util::StreamExt;
26-
use fuzzy_matcher::FuzzyMatcher;
27-
use grep_regex::RegexMatcherBuilder;
28-
use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
2910
use helix_core::{
3011
char_idx_at_visual_offset, comment,
3112
doc_formatter::TextFormat,
@@ -35,7 +16,7 @@ use helix_core::{
3516
indent::IndentStyle,
3617
line_ending::{get_line_ending_of_str, line_end_char_index, str_is_line_ending},
3718
match_brackets,
38-
movement::{self, move_vertically_visual, Direction, Movement},
19+
movement::{self, move_vertically_visual, Direction},
3920
object, pos_at_coords,
4021
regex::{self, Regex, RegexBuilder},
4122
search::{self, CharMatcher},
@@ -47,7 +28,6 @@ use helix_core::{
4728
visual_offset_from_block, LineEnding, Position, Range, Rope, RopeGraphemes, RopeSlice,
4829
Selection, SmallVec, Tendril, Transaction,
4930
};
50-
use helix_vcs::Hunk;
5131
use helix_view::{
5232
clipboard::ClipboardType,
5333
document::{FormatterError, Mode, SCRATCH_BUFFER_NAME},
@@ -59,17 +39,37 @@ use helix_view::{
5939
view::View,
6040
Document, DocumentId, Editor, ViewId,
6141
};
62-
use ignore::{DirEntry, WalkBuilder, WalkState};
63-
use once_cell::sync::Lazy;
64-
use serde::de::{self, Deserialize, Deserializer};
42+
43+
use anyhow::{anyhow, bail, ensure, Context as _};
44+
use fuzzy_matcher::FuzzyMatcher;
45+
use insert::*;
46+
use movement::Movement;
47+
48+
use crate::{
49+
args,
50+
compositor::{self, Component, Compositor},
51+
filter_picker_entry,
52+
job::Callback,
53+
keymap::CommandList,
54+
ui::{self, menu::{Cell, Row}, overlay::overlayed, FilePicker, Picker, Popup, Prompt, PromptEvent},
55+
};
56+
57+
use crate::job::{self, Jobs};
58+
use futures_util::StreamExt;
59+
use std::{collections::HashMap, fmt, future::Future };
60+
use std::{collections::HashSet, num::NonZeroUsize};
61+
6562
use std::{
6663
borrow::Cow,
67-
collections::{HashMap, HashSet},
68-
fmt,
69-
future::Future,
70-
num::NonZeroUsize,
7164
path::{Path, PathBuf},
7265
};
66+
67+
use once_cell::sync::Lazy;
68+
use serde::de::{self, Deserialize, Deserializer};
69+
70+
use grep_regex::RegexMatcherBuilder;
71+
use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
72+
use ignore::{DirEntry, WalkBuilder, WalkState};
7373
use tokio_stream::wrappers::UnboundedReceiverStream;
7474

7575
pub type OnKeyCallback = Box<dyn FnOnce(&mut Context, KeyEvent)>;

helix-term/src/commands/typed.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use std::fmt::Write;
22
use std::ops::Deref;
33

4-
use super::*;
54
use crate::job::*;
65

6+
use super::*;
7+
78
use helix_core::encoding;
89
use helix_view::editor::{Action, CloseError, ConfigEvent};
910
use serde_json::Value;

0 commit comments

Comments
 (0)