mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 06:28:41 +02:00
Remove nu-glob
's dependency on nu-protocol
(#15349)
# Description This PR solves a circular dependency issue (`nu-test-support` needs `nu-glob` which needs `nu-protocol` which needs `nu-test-support`). This was done by making the glob functions that any type that implements `Interruptible` to remove the dependency on `Signals`. # After Submitting Make `Paths.next()` a O(1) operation so that cancellation/interrupt handling can be moved to the caller (e.g., by wrapping the `Paths` iterator in a cancellation iterator).
This commit is contained in:
@ -9,6 +9,7 @@ use lsp_types::{
|
||||
TextDocumentPositionParams, TextEdit, Uri, WorkspaceEdit, WorkspaceFolder,
|
||||
};
|
||||
use miette::{miette, IntoDiagnostic, Result};
|
||||
use nu_glob::Uninterruptible;
|
||||
use nu_protocol::{
|
||||
engine::{EngineState, StateWorkingSet},
|
||||
Span,
|
||||
@ -42,7 +43,7 @@ fn find_nu_scripts_in_folder(folder_uri: &Uri) -> Result<nu_glob::Paths> {
|
||||
return Err(miette!("\nworkspace folder does not exist."));
|
||||
}
|
||||
let pattern = format!("{}/**/*.nu", path.to_string_lossy());
|
||||
nu_glob::glob(&pattern, None).into_diagnostic()
|
||||
nu_glob::glob(&pattern, Uninterruptible).into_diagnostic()
|
||||
}
|
||||
|
||||
impl LanguageServer {
|
||||
|
Reference in New Issue
Block a user