Text-completion picker to select a project
This commit is contained in:
@@ -67,6 +67,25 @@ impl IoApi {
|
||||
Ok(Json(entries))
|
||||
}
|
||||
|
||||
/// List files and folders at an absolute path (not scoped to the project root).
|
||||
#[oai(path = "/io/fs/list/absolute", method = "post")]
|
||||
async fn list_directory_absolute(
|
||||
&self,
|
||||
payload: Json<FilePathPayload>,
|
||||
) -> OpenApiResult<Json<Vec<io_fs::FileEntry>>> {
|
||||
let entries = io_fs::list_directory_absolute(payload.0.path)
|
||||
.await
|
||||
.map_err(bad_request)?;
|
||||
Ok(Json(entries))
|
||||
}
|
||||
|
||||
/// Get the user's home directory.
|
||||
#[oai(path = "/io/fs/home", method = "get")]
|
||||
async fn get_home_directory(&self) -> OpenApiResult<Json<String>> {
|
||||
let home = io_fs::get_home_directory().map_err(bad_request)?;
|
||||
Ok(Json(home))
|
||||
}
|
||||
|
||||
/// Search the currently open project for files containing the provided query string.
|
||||
#[oai(path = "/io/search", method = "post")]
|
||||
async fn search_files(
|
||||
|
||||
Reference in New Issue
Block a user