Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ bytes = { version = "1.11.1", default-features = false }
toml_edit = { version = "0.25.4", features = ["serde"] }
globset = { version = "0.4.18", default-features = false }
reqwest = { version = "0.13.2", optional = true, features = ["rustls", "stream"] }
dunce = "1.0.5"

[dev-dependencies]
assert_cmd = "2.1.2"
Expand Down
13 changes: 9 additions & 4 deletions core/src/commands/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ pub fn do_sources_local_src_project_no_deps(
project: &LocalSrcProject,
include_index: bool,
) -> Result<Vec<Utf8PathBuf>, LocalSourcesError> {
let unix_srcs = do_sources_project_no_deps(project, include_index)?;
let unix_sources = do_sources_project_no_deps(project, include_index)?;

let srcs: Result<Vec<_>, _> = unix_srcs
let sources: Result<Vec<_>, _> = unix_sources
.iter()
.map(|path| project.get_source_path(path))
.collect();

Ok(srcs?)
Ok(sources?)
}

/// Transitively resolve a list of usages (typically the usages of some project)
Expand Down Expand Up @@ -136,5 +136,10 @@ pub fn enumerate_projects_lock<Env: ReadEnvironment>(
Vec<<Env as ReadEnvironment>::InterchangeProjectRead>,
ResolutionError<<Env as ReadEnvironment>::ReadError>,
> {
lock.resolve_projects(env)
let projects = lock
.resolve_projects(env)?
.into_iter()
.filter_map(|(_, project_read)| project_read)
.collect();
Ok(projects)
}
10 changes: 8 additions & 2 deletions core/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#[cfg(feature = "filesystem")]
use camino::Utf8PathBuf;

#[cfg(feature = "filesystem")]
use crate::{project::local_src::LocalSrcProject, workspace::Workspace};

#[derive(Debug, Default)]
pub struct ProjectContext {
/// Root directory of current workspace
/// Current workspace if found
#[cfg(feature = "filesystem")]
pub current_workspace: Option<Workspace>,
/// Root directory of current project
/// Current project if found
#[cfg(feature = "filesystem")]
pub current_project: Option<LocalSrcProject>,
/// Path to current directory
#[cfg(feature = "filesystem")]
pub current_directory: Utf8PathBuf,
}
Loading
Loading