Skip to content

Commit bfca2ca

Browse files
committed
fix: reval file or folder on explorer
1 parent d1e7383 commit bfca2ca

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

packages/ai-native/src/browser/components/ChatEditor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const CodeBlock = ({
180180
for (const root of roots) {
181181
uri = new URI(root.uri).resolve(text);
182182
try {
183-
await commandService?.executeCommand(FILE_COMMANDS.LOCATION.id, uri);
183+
await commandService?.executeCommand(FILE_COMMANDS.REVEAL_IN_EXPLORER.id, uri);
184184
if (type === MentionType.FILE) {
185185
await commandService?.executeCommand(EDITOR_COMMANDS.OPEN_RESOURCE.id, uri);
186186
}

packages/file-tree-next/src/browser/file-tree-contribution.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,6 @@ export class FileTreeContribution
444444

445445
commands.registerCommand(FILE_COMMANDS.LOCATION, {
446446
execute: (locationUri?: URI) => {
447-
const handler = this.mainLayoutService.getTabbarHandler(EXPLORER_CONTAINER_ID);
448-
if (handler && !handler.isVisible) {
449-
handler.activate();
450-
setTimeout(() => {
451-
handler.setCollapsed(RESOURCE_VIEW_ID, false);
452-
}, 200);
453-
}
454447
if (locationUri) {
455448
this.revealFile(locationUri);
456449
} else if (this.fileTreeModelService.selectedFiles && this.fileTreeModelService.selectedFiles.length > 0) {
@@ -1023,9 +1016,10 @@ export class FileTreeContribution
10231016
const handler = this.mainLayoutService.getTabbarHandler(EXPLORER_CONTAINER_ID);
10241017
if (handler && !handler.isVisible) {
10251018
handler.activate();
1026-
}
1027-
if (handler && handler.isCollapsed(RESOURCE_VIEW_ID)) {
1028-
handler?.setCollapsed(RESOURCE_VIEW_ID, false);
1019+
setTimeout(() => {
1020+
// FIXME: 目前通过 handler.isCollapsed 方法获取到的这段状态不准确
1021+
handler.setCollapsed(RESOURCE_VIEW_ID, false);
1022+
}, 200);
10291023
}
10301024
if (!uri && this.workbenchEditorService.currentEditor?.currentUri) {
10311025
uri = this.workbenchEditorService.currentEditor.currentUri;

0 commit comments

Comments
 (0)