(provider: ClineProvider, content: string)
| 246 | } |
| 247 | |
| 248 | export async function handleCreateWorktreeInclude(provider: ClineProvider, content: string): Promise<WorktreeResult> { |
| 249 | const cwd = provider.cwd |
| 250 | |
| 251 | try { |
| 252 | await worktreeIncludeService.createWorktreeInclude(cwd, content) |
| 253 | |
| 254 | // Open the file in the editor for easy editing |
| 255 | try { |
| 256 | const filePath = path.join(cwd, ".worktreeinclude") |
| 257 | const document = await vscode.workspace.openTextDocument(filePath) |
| 258 | await vscode.window.showTextDocument(document) |
| 259 | } catch { |
| 260 | // Opening the file in editor is a convenience feature - don't fail the operation |
| 261 | } |
| 262 | |
| 263 | return { |
| 264 | success: true, |
| 265 | message: ".worktreeinclude file created", |
| 266 | } |
| 267 | } catch (error) { |
| 268 | const errorMessage = error instanceof Error ? error.message : String(error) |
| 269 | return { |
| 270 | success: false, |
| 271 | message: `Failed to create .worktreeinclude: ${errorMessage}`, |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | export async function handleCheckoutBranch(provider: ClineProvider, branch: string): Promise<WorktreeResult> { |
| 277 | const cwd = provider.cwd |
no test coverage detected