Skip to content

Commit 93b6a9c

Browse files
committed
Add find in folder command to workspace and context views
1 parent 1daa10a commit 93b6a9c

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

‎packages/vscode/package.json‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@
281281
"title": "Reveal in Explorer View",
282282
"category": "Code Web Chat"
283283
},
284+
{
285+
"command": "codeWebChat.findInFolder",
286+
"title": "Find in Folder...",
287+
"category": "Code Web Chat",
288+
"icon": "$(search)"
289+
},
284290
{
285291
"command": "codeWebChat.checkpoints",
286292
"title": "%codeWebChat.checkpoints.title%",
@@ -573,15 +579,20 @@
573579
"when": "view == codeWebChatViewWorkspace || view == codeWebChatViewContext",
574580
"group": "1_modification@3"
575581
},
582+
{
583+
"command": "codeWebChat.findInFolder",
584+
"when": "(view == codeWebChatViewWorkspace || view == codeWebChatViewContext) && (viewItem == directory || viewItem == workspaceRoot || viewItem == contextDirectory || viewItem == contextWorkspaceRoot)",
585+
"group": "1_modification@4"
586+
},
576587
{
577588
"command": "codeWebChat.revealInExplorer",
578589
"when": "view == codeWebChatViewWorkspace || view == codeWebChatViewContext",
579-
"group": "1_modification@4"
590+
"group": "1_modification@5"
580591
},
581592
{
582593
"command": "codeWebChat.setRange",
583594
"when": "(view == codeWebChatViewWorkspace || view == codeWebChatViewContext) && viewItem == file",
584-
"group": "1_modification@5"
595+
"group": "1_modification@6"
585596
}
586597
]
587598
},

‎packages/vscode/src/extension.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@ export async function activate(context: vscode.ExtensionContext) {
146146
)
147147
}
148148
}
149+
),
150+
vscode.commands.registerCommand(
151+
'codeWebChat.findInFolder',
152+
async (item: any) => {
153+
if (item && item.resourceUri) {
154+
await vscode.commands.executeCommand('workbench.action.findInFiles', {
155+
query: '',
156+
filesToInclude: item.resourceUri.fsPath,
157+
triggerSearch: false
158+
})
159+
}
160+
}
149161
)
150162
)
151163
}

0 commit comments

Comments
 (0)