mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
Refactor EditTool.Name to use centralized EDIT_TOOL_NAME (#11343)
This commit is contained in:
@@ -34,6 +34,7 @@ import type {
|
||||
} from './modifiable-tool.js';
|
||||
import { IdeClient } from '../ide/ide-client.js';
|
||||
import { safeLiteralReplace } from '../utils/textUtils.js';
|
||||
import { EDIT_TOOL_NAME } from './tool-names.js';
|
||||
|
||||
export function applyReplacement(
|
||||
currentContent: string | null,
|
||||
@@ -464,7 +465,7 @@ export class EditTool
|
||||
extends BaseDeclarativeTool<EditToolParams, ToolResult>
|
||||
implements ModifiableDeclarativeTool<EditToolParams>
|
||||
{
|
||||
static readonly Name = 'replace';
|
||||
static readonly Name = EDIT_TOOL_NAME;
|
||||
constructor(private readonly config: Config) {
|
||||
super(
|
||||
EditTool.Name,
|
||||
|
||||
@@ -39,6 +39,7 @@ import { SmartEditCorrectionEvent } from '../telemetry/types.js';
|
||||
import { logSmartEditCorrectionEvent } from '../telemetry/loggers.js';
|
||||
|
||||
import { correctPath } from '../utils/pathCorrector.js';
|
||||
import { EDIT_TOOL_NAME } from './tool-names.js';
|
||||
interface ReplacementContext {
|
||||
params: EditToolParams;
|
||||
currentContent: string;
|
||||
@@ -815,7 +816,7 @@ export class SmartEditTool
|
||||
extends BaseDeclarativeTool<EditToolParams, ToolResult>
|
||||
implements ModifiableDeclarativeTool<EditToolParams>
|
||||
{
|
||||
static readonly Name = 'replace';
|
||||
static readonly Name = EDIT_TOOL_NAME;
|
||||
|
||||
constructor(private readonly config: Config) {
|
||||
super(
|
||||
|
||||
@@ -13,6 +13,7 @@ export const WRITE_TODOS_TOOL_NAME = 'write_todos';
|
||||
export const WRITE_FILE_TOOL_NAME = 'write_file';
|
||||
export const WEB_SEARCH_TOOL_NAME = 'google_web_search';
|
||||
export const WEB_FETCH_TOOL_NAME = 'web_fetch';
|
||||
export const EDIT_TOOL_NAME = 'replace';
|
||||
|
||||
// TODO: Migrate other tool names here to follow this pattern and prevent future circular dependencies.
|
||||
// Candidates for migration:
|
||||
|
||||
Reference in New Issue
Block a user