mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-14 07:12:00 +01:00
fixes #78510
This commit is contained in:
@@ -11,6 +11,7 @@ import { IDecorationsProvider, IDecorationData } from 'vs/workbench/services/dec
|
||||
import { listInvalidItemForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IExplorerService } from 'vs/workbench/contrib/files/common/files';
|
||||
import { explorerRootErrorEmitter } from 'vs/workbench/contrib/files/browser/views/explorerViewer';
|
||||
|
||||
export class ExplorerDecorationsProvider implements IDecorationsProvider {
|
||||
readonly label: string = localize('label', "Explorer");
|
||||
@@ -30,6 +31,9 @@ export class ExplorerDecorationsProvider implements IDecorationsProvider {
|
||||
this._onDidChange.fire([change.item.resource]);
|
||||
}
|
||||
}));
|
||||
this.toDispose.add(explorerRootErrorEmitter.event((resource => {
|
||||
this._onDidChange.fire([resource]);
|
||||
})));
|
||||
}
|
||||
|
||||
get onDidChange(): Event<URI[]> {
|
||||
|
||||
@@ -46,6 +46,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { findValidPasteFileTarget } from 'vs/workbench/contrib/files/browser/fileActions';
|
||||
import { FuzzyScore, createMatches } from 'vs/base/common/filters';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
||||
|
||||
@@ -60,6 +61,7 @@ export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
||||
}
|
||||
}
|
||||
|
||||
export const explorerRootErrorEmitter = new Emitter<URI>();
|
||||
export class ExplorerDataSource implements IAsyncDataSource<ExplorerItem | ExplorerItem[], ExplorerItem> {
|
||||
|
||||
constructor(
|
||||
@@ -87,8 +89,9 @@ export class ExplorerDataSource implements IAsyncDataSource<ExplorerItem | Explo
|
||||
// Single folder create a dummy explorer item to show error
|
||||
const placeholder = new ExplorerItem(element.resource, undefined, false);
|
||||
placeholder.isError = true;
|
||||
|
||||
return [placeholder];
|
||||
} else {
|
||||
explorerRootErrorEmitter.fire(element.resource);
|
||||
}
|
||||
} else {
|
||||
// Do not show error for roots since we already use an explorer decoration to notify user
|
||||
|
||||
@@ -247,9 +247,14 @@ export class ExplorerItem {
|
||||
// Resolve metadata only when the mtime is needed since this can be expensive
|
||||
// Mtime is only used when the sort order is 'modified'
|
||||
const resolveMetadata = explorerService.sortOrder === 'modified';
|
||||
const stat = await fileService.resolve(this.resource, { resolveSingleChildDescendants: true, resolveMetadata });
|
||||
const resolved = ExplorerItem.create(stat, this);
|
||||
ExplorerItem.mergeLocalWithDisk(resolved, this);
|
||||
try {
|
||||
const stat = await fileService.resolve(this.resource, { resolveSingleChildDescendants: true, resolveMetadata });
|
||||
const resolved = ExplorerItem.create(stat, this);
|
||||
ExplorerItem.mergeLocalWithDisk(resolved, this);
|
||||
} catch (e) {
|
||||
this.isError = true;
|
||||
throw e;
|
||||
}
|
||||
this._isDirectoryResolved = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user