mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 22:47:43 +02:00
cleanup
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
use derive_new::new;
|
||||
use rustyline::completion::{self, Completer, FilenameCompleter};
|
||||
use rustyline::line_buffer::LineBuffer;
|
||||
use rustyline::completion::{Completer, FilenameCompleter};
|
||||
|
||||
#[derive(new)]
|
||||
crate struct NuCompleter {
|
||||
@ -8,20 +7,6 @@ crate struct NuCompleter {
|
||||
//pub commands: indexmap::IndexMap<String, Arc<dyn Command>>,
|
||||
}
|
||||
|
||||
pub struct CompletionPair {
|
||||
pub display: String,
|
||||
pub replacement: String,
|
||||
}
|
||||
|
||||
impl Into<completion::Pair> for CompletionPair {
|
||||
fn into(self) -> completion::Pair {
|
||||
completion::Pair {
|
||||
display: self.display,
|
||||
replacement: self.replacement,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl NuCompleter {
|
||||
pub fn complete(
|
||||
&self,
|
||||
@ -89,8 +74,8 @@ impl NuCompleter {
|
||||
Ok((replace_pos, completions))
|
||||
}
|
||||
|
||||
fn update(&self, line: &mut LineBuffer, start: usize, elected: &str) {
|
||||
let end = line.pos();
|
||||
line.replace(start..end, elected)
|
||||
}
|
||||
// fn update(&self, line: &mut LineBuffer, start: usize, elected: &str) {
|
||||
// let end = line.pos();
|
||||
// line.replace(start..end, elected)
|
||||
// }
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::commands::command::{CallInfo, EvaluatedStaticCommandArgs};
|
||||
use crate::commands::command::EvaluatedStaticCommandArgs;
|
||||
use crate::object::dir_entry_dict;
|
||||
use crate::prelude::*;
|
||||
use crate::shell::completer::NuCompleter;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::commands::command::{CallInfo, EvaluatedStaticCommandArgs};
|
||||
use crate::commands::command::EvaluatedStaticCommandArgs;
|
||||
use crate::errors::ShellError;
|
||||
use crate::stream::{InputStream, OutputStream};
|
||||
use crate::stream::OutputStream;
|
||||
|
||||
pub trait Shell {
|
||||
fn name(&self) -> String;
|
||||
|
@ -1,8 +1,8 @@
|
||||
use crate::commands::command::{CallInfo, EvaluatedStaticCommandArgs};
|
||||
use crate::commands::command::EvaluatedStaticCommandArgs;
|
||||
use crate::errors::ShellError;
|
||||
use crate::shell::filesystem_shell::FilesystemShell;
|
||||
use crate::shell::shell::Shell;
|
||||
use crate::stream::{InputStream, OutputStream};
|
||||
use crate::stream::OutputStream;
|
||||
use std::error::Error;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::commands::command::{CallInfo, EvaluatedStaticCommandArgs};
|
||||
use crate::commands::command::EvaluatedStaticCommandArgs;
|
||||
use crate::prelude::*;
|
||||
use crate::shell::shell::Shell;
|
||||
use std::ffi::OsStr;
|
||||
|
Reference in New Issue
Block a user