Skip to content

Commit ddcbbad

Browse files
committed
Add reveal in Explorer command for workspace and open editor items
1 parent 4de776f commit ddcbbad

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

packages/vscode/package.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@
271271
"title": "Reference in Prompt",
272272
"category": "Code Web Chat"
273273
},
274+
{
275+
"command": "codeWebChat.revealInExplorer",
276+
"title": "Reveal in Explorer View",
277+
"category": "Code Web Chat"
278+
},
274279
{
275280
"command": "codeWebChat.checkpoints",
276281
"title": "%codeWebChat.checkpoints.title%",
@@ -369,6 +374,10 @@
369374
"command": "codeWebChat.referenceInPrompt",
370375
"when": "false"
371376
},
377+
{
378+
"command": "codeWebChat.revealInExplorer",
379+
"when": "false"
380+
},
372381
{
373382
"command": "codeWebChat.openRepository",
374383
"when": "false"
@@ -516,10 +525,15 @@
516525
"group": "1_modification@3"
517526
},
518527
{
519-
"command": "codeWebChat.setRange",
528+
"command": "codeWebChat.revealInExplorer",
520529
"when": "view == codeWebChatViewOpenEditors && viewItem == openEditor",
521530
"group": "1_modification@4"
522531
},
532+
{
533+
"command": "codeWebChat.setRange",
534+
"when": "view == codeWebChatViewOpenEditors && viewItem == openEditor",
535+
"group": "1_modification@5"
536+
},
523537
{
524538
"command": "codeWebChat.newFile",
525539
"when": "view == codeWebChatViewWorkspace && viewItem == directory",
@@ -545,10 +559,15 @@
545559
"when": "view == codeWebChatViewWorkspace || view == codeWebChatViewContext",
546560
"group": "1_modification@3"
547561
},
562+
{
563+
"command": "codeWebChat.revealInExplorer",
564+
"when": "view == codeWebChatViewWorkspace || view == codeWebChatViewContext",
565+
"group": "1_modification@4"
566+
},
548567
{
549568
"command": "codeWebChat.setRange",
550569
"when": "(view == codeWebChatViewWorkspace || view == codeWebChatViewContext) && viewItem == file",
551-
"group": "1_modification@4"
570+
"group": "1_modification@5"
552571
}
553572
]
554573
},

packages/vscode/src/extension.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ export async function activate(context: vscode.ExtensionContext) {
133133
settings_provider.createOrShow(section)
134134
}
135135
),
136-
generate_commit_message_command(context)
136+
generate_commit_message_command(context),
137+
vscode.commands.registerCommand(
138+
'codeWebChat.revealInExplorer',
139+
async (item: any) => {
140+
if (item && item.resourceUri) {
141+
await vscode.commands.executeCommand(
142+
'revealInExplorer',
143+
item.resourceUri
144+
)
145+
}
146+
}
147+
)
137148
)
138149
}

0 commit comments

Comments
 (0)