MCPcopy Create free account
hub / github.com/anus-dev/ANUS / openDiff

Method openDiff

packages/core/src/ide/ide-client.ts:146–165  ·  view source on GitHub ↗

* 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,
  )

Source from the content-addressed store, hash-verified

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 {

Callers 2

shouldConfirmExecuteMethod · 0.80
shouldConfirmExecuteMethod · 0.80

Calls 2

debugMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected