mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 05:42:54 -07:00
Fix build.
This commit is contained in:
@@ -928,7 +928,7 @@ class EditToolInvocation
|
|||||||
: `Successfully modified file: ${this.params.file_path} (${editData.occurrences} replacements).`,
|
: `Successfully modified file: ${this.params.file_path} (${editData.occurrences} replacements).`,
|
||||||
];
|
];
|
||||||
const snippet = getDiffContextSnippet(
|
const snippet = getDiffContextSnippet(
|
||||||
originalContent,
|
editData.currentContent ?? '',
|
||||||
finalContent,
|
finalContent,
|
||||||
5,
|
5,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ export interface RipGrepToolParams {
|
|||||||
interface GrepMatch {
|
interface GrepMatch {
|
||||||
filePath: string;
|
filePath: string;
|
||||||
absolutePath: string;
|
absolutePath: string;
|
||||||
absolutePath: string;
|
|
||||||
lineNumber: number;
|
lineNumber: number;
|
||||||
line: string;
|
line: string;
|
||||||
isContext?: boolean;
|
isContext?: boolean;
|
||||||
@@ -329,11 +328,10 @@ class GrepToolInvocation extends BaseToolInvocation<
|
|||||||
fileMatches[0].absolutePath,
|
fileMatches[0].absolutePath,
|
||||||
'utf8',
|
'utf8',
|
||||||
);
|
);
|
||||||
fileLines = content.split(/
|
fileLines = content.split(/\r?\n/);
|
||||||
?
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
debugLogger.warn(
|
debugLogger.warn(
|
||||||
debugLogger.warn(
|
`Failed to read file for context: ${fileMatches[0].absolutePath}`,
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -358,7 +356,9 @@ class GrepToolInvocation extends BaseToolInvocation<
|
|||||||
});
|
});
|
||||||
seenLines.add(i + 1);
|
seenLines.add(i + 1);
|
||||||
} else if (i + 1 === match.lineNumber) {
|
} else if (i + 1 === match.lineNumber) {
|
||||||
} else if (i + 1 === match.lineNumber) {
|
const index = newFileMatches.findIndex(
|
||||||
|
(m) => m.lineNumber === i + 1,
|
||||||
|
);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
newFileMatches[index].isContext = false;
|
newFileMatches[index].isContext = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user