mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-10 00:47:46 +00:00
fix unit test
This commit is contained in:
@@ -370,26 +370,26 @@ Only use a single line of '=======' between search and replacement content, beca
|
||||
}
|
||||
}
|
||||
|
||||
getProgressStatus(toolUse: ToolUse, result?: DiffResult): ToolProgressStatus {
|
||||
const diffContent = toolUse.params.diff
|
||||
if (diffContent) {
|
||||
const icon = "diff-multiple"
|
||||
const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
|
||||
if (toolUse.partial) {
|
||||
if (diffContent.length < 1000 || (diffContent.length / 50) % 10 === 0) {
|
||||
return { icon, text: `${searchBlockCount}` }
|
||||
}
|
||||
} else if (result) {
|
||||
if (result.failParts?.length) {
|
||||
return {
|
||||
icon,
|
||||
text: `${searchBlockCount - result.failParts.length}/${searchBlockCount}`,
|
||||
}
|
||||
} else {
|
||||
return { icon, text: `${searchBlockCount}` }
|
||||
}
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
// getProgressStatus(toolUse: ToolUse, result?: DiffResult): ToolProgressStatus {
|
||||
// const diffContent = toolUse.params.diff
|
||||
// if (diffContent) {
|
||||
// const icon = "diff-multiple"
|
||||
// const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
|
||||
// if (toolUse.partial) {
|
||||
// if (diffContent.length < 1000 || (diffContent.length / 50) % 10 === 0) {
|
||||
// return { icon, text: `${searchBlockCount}` }
|
||||
// }
|
||||
// } else if (result) {
|
||||
// if (result.failParts?.length) {
|
||||
// return {
|
||||
// icon,
|
||||
// text: `${searchBlockCount - result.failParts.length}/${searchBlockCount}`,
|
||||
// }
|
||||
// } else {
|
||||
// return { icon, text: `${searchBlockCount}` }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return {}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { applyPatch } from "diff"
|
||||
import { DiffStrategy, DiffResult } from "../types"
|
||||
import { applyPatch } from "diff";
|
||||
|
||||
import { DiffResult, DiffStrategy } from "../types";
|
||||
|
||||
export class UnifiedDiffStrategy implements DiffStrategy {
|
||||
|
||||
getName(): string {
|
||||
return "Unified"
|
||||
}
|
||||
|
||||
getToolDescription(args: { cwd: string; toolOptions?: { [key: string]: string } }): string {
|
||||
return `## apply_diff
|
||||
Description: Apply a unified diff to a file at the specified path. This tool is useful when you need to make specific modifications to a file based on a set of changes provided in unified diff format (diff -U3).
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
|
||||
import { StdioClientTransport, StdioServerParameters } from "@modelcontextprotocol/sdk/client/stdio.js"
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import * as vscode from "vscode"
|
||||
// @ts-nocheck
|
||||
|
||||
import { ClineProvider } from "../../core/webview/ClineProvider"
|
||||
|
||||
import { McpHub } from "./McpHub"
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
|
||||
import { Mode } from "../../../shared/modes"
|
||||
import { fileExistsAtPath } from "../../../utils/fs"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user