diff --git a/crates/engine/src/tools/build_tools.rs b/crates/engine/src/tools/build_tools.rs index 98a62d0a..39913d0e 100644 --- a/crates/engine/src/tools/build_tools.rs +++ b/crates/engine/src/tools/build_tools.rs @@ -42,7 +42,7 @@ pub fn specs() -> Vec { spec( "build_files_list", "List project files", - "List files and folders in the project being built (default: app/), a few levels deep. Paths are relative to the project folder; build output and dependencies (node_modules, target, dist…) are skipped.", + "List files and folders in the app: app/ usually, or the project folder when the app is edited in place. A few levels deep; paths are relative to the project folder; build output and dependencies (node_modules, target, dist…) are skipped.", "Shows the files being built.", Effects::READ_ONLY, schema_of::, @@ -99,7 +99,8 @@ pub fn specs() -> Vec { #[derive(Debug, Deserialize, JsonSchema)] #[serde(deny_unknown_fields)] pub struct ListParams { - /// A folder relative to the project (default `app`). + /// A folder relative to the project (default: the app folder; for a project edited in + /// place, the project folder itself). #[serde(default)] pub path: Option, /// How many levels down (default 4, at most 8). @@ -217,7 +218,8 @@ fn refused(why: String) -> ToolError { fn build_files_list(ctx: &mut Ctx<'_>, params: Value) -> Result { let p: ListParams = parse_params(params)?; let ws = workspace(ctx)?; - let root = in_project(&ws, p.path.as_deref().unwrap_or("app"))?; + let default = if ws.manifest.app_in_root { "." } else { "app" }; + let root = in_project(&ws, p.path.as_deref().unwrap_or(default))?; let depth = p.depth.unwrap_or(4).min(8); const SKIP: [&str; 8] = ["node_modules", "target", "dist", "build", ".git", "Library", "Temp", "Intermediate"]; let mut entries = Vec::new(); @@ -232,6 +234,11 @@ fn build_files_list(ctx: &mut Ctx<'_>, params: Value) -> Result, params: Value) -> Result, params: Value) -> Result { @@ -362,7 +370,7 @@ fn build_command_run(ctx: &mut Ctx<'_>, params: Value) -> Result bool { #[cfg(unix)]