Skip to content

Commit

Permalink
revert some cleanup of use statements
Browse files Browse the repository at this point in the history
...in the hopes that it simplifies review.
The changes should have probably be codified into
`cargo fmt`.
  • Loading branch information
gibbz00 committed Feb 15, 2023
1 parent 159150b commit 683931a
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 48 deletions.
1 change: 1 addition & 0 deletions helix-term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ helix-loader = { version = "0.6", path = "../helix-loader" }

anyhow = "1"
once_cell = "1.17"

which = "4.4"

tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] }
Expand Down
39 changes: 21 additions & 18 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
use arc_swap::{access::Map, ArcSwap};
use futures_util::Stream;
use helix_core::{
diagnostic::{DiagnosticTag, NumberOrString},
path::get_relative_path,
pos_at_coords, syntax, Selection,
};
use serde_json::json;
use tui::backend::Backend;

use crate::{
args::Args,
commands::apply_workspace_edit,
Expand All @@ -7,22 +17,7 @@ use crate::{
keymap::Keymap,
ui::{self, overlay::overlayed},
};
use anyhow::{Context, Error};
use arc_swap::{access::Map, ArcSwap};
use crossterm::{
event::{
DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste,
EnableFocusChange, EnableMouseCapture, Event as CrosstermEvent,
},
execute, terminal,
tty::IsTty,
};
use futures_util::Stream;
use helix_core::{
diagnostic::{DiagnosticTag, NumberOrString},
path::get_relative_path,
pos_at_coords, syntax, Selection,
};

use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
use helix_view::{
align_view,
Expand All @@ -34,14 +29,22 @@ use helix_view::{
Align, Editor,
};
use log::{debug, error, warn};
use serde_json::json;
use std::{
io::{stdin, stdout, Write},
sync::Arc,
time::{Duration, Instant},
};
use tui::backend::Backend;

use anyhow::{Context, Error};

use crossterm::{
event::{
DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste,
EnableFocusChange, EnableMouseCapture, Event as CrosstermEvent,
},
execute, terminal,
tty::IsTty,
};
#[cfg(not(windows))]
use {
signal_hook::{consts::signal, low_level},
Expand Down
63 changes: 34 additions & 29 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,10 @@ pub(crate) mod lsp;
pub(crate) mod typed;

pub use dap::*;
use helix_vcs::Hunk;
pub use lsp::*;
pub use typed::*;

use crate::{
args,
commands::insert::*,
compositor::{self, Component, Compositor},
filter_picker_entry,
job::{self, Callback, Jobs},
keymap::CommandList,
ui::{
self,
menu::{Cell, Row},
overlay::overlayed,
FilePicker, Picker, Popup, Prompt, PromptEvent,
},
};

use anyhow::{anyhow, bail, ensure, Context as _};
use futures_util::StreamExt;
use fuzzy_matcher::FuzzyMatcher;
use grep_regex::RegexMatcherBuilder;
use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
use helix_core::{
char_idx_at_visual_offset, comment,
doc_formatter::TextFormat,
Expand All @@ -35,7 +16,7 @@ use helix_core::{
indent::IndentStyle,
line_ending::{get_line_ending_of_str, line_end_char_index, str_is_line_ending},
match_brackets,
movement::{self, move_vertically_visual, Direction, Movement},
movement::{self, move_vertically_visual, Direction},
object, pos_at_coords,
regex::{self, Regex, RegexBuilder},
search::{self, CharMatcher},
Expand All @@ -47,7 +28,6 @@ use helix_core::{
visual_offset_from_block, LineEnding, Position, Range, Rope, RopeGraphemes, RopeSlice,
Selection, SmallVec, Tendril, Transaction,
};
use helix_vcs::Hunk;
use helix_view::{
clipboard::ClipboardType,
document::{FormatterError, Mode, SCRATCH_BUFFER_NAME},
Expand All @@ -59,17 +39,42 @@ use helix_view::{
view::View,
Document, DocumentId, Editor, ViewId,
};
use ignore::{DirEntry, WalkBuilder, WalkState};
use once_cell::sync::Lazy;
use serde::de::{self, Deserialize, Deserializer};

use anyhow::{anyhow, bail, ensure, Context as _};
use fuzzy_matcher::FuzzyMatcher;
use insert::*;
use movement::Movement;

use crate::{
args,
compositor::{self, Component, Compositor},
filter_picker_entry,
job::Callback,
keymap::CommandList,
ui::{
self,
menu::{Cell, Row},
overlay::overlayed,
FilePicker, Picker, Popup, Prompt, PromptEvent,
},
};

use crate::job::{self, Jobs};
use futures_util::StreamExt;
use std::{collections::HashMap, fmt, future::Future};
use std::{collections::HashSet, num::NonZeroUsize};

use std::{
borrow::Cow,
collections::{HashMap, HashSet},
fmt,
future::Future,
num::NonZeroUsize,
path::{Path, PathBuf},
};

use once_cell::sync::Lazy;
use serde::de::{self, Deserialize, Deserializer};

use grep_regex::RegexMatcherBuilder;
use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
use ignore::{DirEntry, WalkBuilder, WalkState};
use tokio_stream::wrappers::UnboundedReceiverStream;

pub type OnKeyCallback = Box<dyn FnOnce(&mut Context, KeyEvent)>;
Expand Down
3 changes: 2 additions & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::fmt::Write;
use std::ops::Deref;

use super::*;
use crate::job::*;

use super::*;

use helix_core::encoding;
use helix_view::editor::{Action, CloseError, ConfigEvent};
use serde_json::Value;
Expand Down

0 comments on commit 683931a

Please sign in to comment.