(
&self,
path: &WorkspacePath,
content: &str,
)
| 96 | } |
| 97 | |
| 98 | async fn write_text( |
| 99 | &self, |
| 100 | path: &WorkspacePath, |
| 101 | content: &str, |
| 102 | ) -> WorkspaceResult<WorkspaceWriteOutcome> { |
| 103 | let resolved = self.local_path_for_write(path)?; |
| 104 | tokio::fs::write(&resolved, content).await.map_err(|e| { |
| 105 | WorkspaceError::Backend(anyhow!( |
| 106 | "Failed to write file {}: {}", |
| 107 | resolved.display(), |
| 108 | e |
| 109 | )) |
| 110 | })?; |
| 111 | |
| 112 | Ok(WorkspaceWriteOutcome { |
| 113 | bytes: content.len(), |
| 114 | lines: content.lines().count(), |
| 115 | }) |
| 116 | } |
| 117 | |
| 118 | async fn list_dir(&self, path: &WorkspacePath) -> WorkspaceResult<Vec<WorkspaceDirEntry>> { |
| 119 | let target = self.local_path_for_read(path)?; |
no test coverage detected