* A diff is accepted with any modifications if the user performs one of the * following actions: * - Clicks the checkbox icon in the IDE to accept * - Runs `command+shift+p` > "ANUS: Accept Diff in IDE" to accept * - Selects "accept" in the CLI UI * - Saves the file via `ctrl/command+
(
filePath: string,
newContent?: string,
)
| 144 | * - Closes the file |
| 145 | */ |
| 146 | async openDiff( |
| 147 | filePath: string, |
| 148 | newContent?: string, |
| 149 | ): Promise<DiffUpdateResult> { |
| 150 | return new Promise<DiffUpdateResult>((resolve, reject) => { |
| 151 | this.diffResponses.set(filePath, resolve); |
| 152 | this.client |
| 153 | ?.callTool({ |
| 154 | name: `openDiff`, |
| 155 | arguments: { |
| 156 | filePath, |
| 157 | newContent, |
| 158 | }, |
| 159 | }) |
| 160 | .catch((err) => { |
| 161 | logger.debug(`callTool for ${filePath} failed:`, err); |
| 162 | reject(err); |
| 163 | }); |
| 164 | }); |
| 165 | } |
| 166 | |
| 167 | async closeDiff(filePath: string): Promise<string | undefined> { |
| 168 | try { |
no test coverage detected