()
| 285 | } |
| 286 | |
| 287 | getDescription(): string { |
| 288 | const relativePath = makeRelative( |
| 289 | this.params.file_path, |
| 290 | this.config.getTargetDir(), |
| 291 | ); |
| 292 | if (this.params.old_string === '') { |
| 293 | return `Create ${shortenPath(relativePath)}`; |
| 294 | } |
| 295 | |
| 296 | const oldStringSnippet = |
| 297 | this.params.old_string.split('\n')[0].substring(0, 30) + |
| 298 | (this.params.old_string.length > 30 ? '...' : ''); |
| 299 | const newStringSnippet = |
| 300 | this.params.new_string.split('\n')[0].substring(0, 30) + |
| 301 | (this.params.new_string.length > 30 ? '...' : ''); |
| 302 | |
| 303 | if (this.params.old_string === this.params.new_string) { |
| 304 | return `No file changes to ${shortenPath(relativePath)}`; |
| 305 | } |
| 306 | return `${shortenPath(relativePath)}: ${oldStringSnippet} => ${newStringSnippet}`; |
| 307 | } |
| 308 | |
| 309 | /** |
| 310 | * Executes the edit operation with the given parameters. |
nothing calls this directly
no test coverage detected