Skip to content

Commit c097fbc

Browse files
authored
Don't allow search using '**' (#1815)
There is a model that really wants to do this. It skips all .gitignore and makes search time out.
1 parent 6759d1c commit c097fbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/extension/tools/node/findTextInFilesTool.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ export class FindTextInFilesTool implements ICopilotTool<IFindTextInFilesToolPar
184184

185185
async resolveInput(input: IFindTextInFilesToolParams, _promptContext: IBuildPromptContext, mode: CopilotToolMode): Promise<IFindTextInFilesToolParams> {
186186
let includePattern = input.includePattern;
187+
if (includePattern === '**') {
188+
includePattern = undefined;
189+
}
190+
187191
if (includePattern && !includePattern.startsWith('**/')) {
188192
includePattern = `**/${includePattern}`;
189193
}

0 commit comments

Comments
 (0)