Skip to content

Commit a3a39de

Browse files
authored
fix: enable grepSearch tool (#1396)
1 parent 93d9c9c commit a3a39de

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/grepSearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class GrepSearch {
168168
// Add search pattern and path
169169
args.push(params.query, path)
170170

171-
this.logging.info(`Executing ripgrep with args: ${args.join(' ')}`)
171+
this.logging.debug(`Executing ripgrep with args: ${args.join(' ')}`)
172172

173173
const options: ChildProcessOptions = {
174174
collect: true,

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/toolServer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import { LspApplyWorkspaceEdit } from './lspApplyWorkspaceEdit'
99
import { McpManager } from './mcp/mcpManager'
1010
import { McpTool } from './mcp/mcpTool'
1111
import { FuzzySearch, FuzzySearchParams } from './fuzzySearch'
12+
import { GrepSearch, GrepSearchParams } from './grepSearch'
1213

1314
export const FsToolsServer: Server = ({ workspace, logging, agent, lsp }) => {
1415
const fsReadTool = new FsRead({ workspace, lsp, logging })
1516
const fsWriteTool = new FsWrite({ workspace, lsp, logging })
1617
const listDirectoryTool = new ListDirectory({ workspace, logging, lsp })
1718
const fuzzySearchTool = new FuzzySearch({ workspace, lsp, logging })
19+
const grepSearchTool = new GrepSearch({ workspace, logging, lsp })
1820

1921
agent.addTool(fsReadTool.getSpec(), async (input: FsReadParams) => {
2022
await fsReadTool.validate(input)
@@ -36,6 +38,11 @@ export const FsToolsServer: Server = ({ workspace, logging, agent, lsp }) => {
3638
return await fuzzySearchTool.invoke(input, token)
3739
})
3840

41+
agent.addTool(grepSearchTool.getSpec(), async (input: GrepSearchParams, token?: CancellationToken) => {
42+
await grepSearchTool.validate(input)
43+
return await grepSearchTool.invoke(input, token)
44+
})
45+
3946
return () => {}
4047
}
4148

0 commit comments

Comments
 (0)