提交 74b19649 编写于 作者: I isidor

gray out nonexistent multi root folder

fixes #29738
上级 c9e07099
......@@ -142,6 +142,10 @@
padding: 0 20px 0 20px;
}
.explorer-viewlet .explorer-item.nonexistent-root {
opacity: 0.5;
}
.explorer-viewlet .explorer-item .monaco-inputbox {
width: 100%;
line-height: normal;
......
......@@ -106,7 +106,14 @@ export class FileDataSource implements IDataSource {
return stat.children;
}, (e: any) => {
this.messageService.show(Severity.Error, e);
stat.exists = false;
stat.hasChildren = false;
if (!stat.isRoot) {
this.messageService.show(Severity.Error, e);
} else {
// We render the roots that do not exist differently, nned to do a refresh
tree.refresh(stat, false);
}
return []; // we could not resolve any children because of an error
});
......@@ -311,6 +318,9 @@ export class FileRenderer implements IRenderer {
if (!editableData) {
templateData.label.element.style.display = 'block';
const extraClasses = ['explorer-item'];
if (!stat.exists && stat.isRoot) {
extraClasses.push('nonexistent-root');
}
templateData.label.setFile(stat.resource, { hidePath: true, fileKind: stat.isRoot ? FileKind.ROOT_FOLDER : stat.isDirectory ? FileKind.FOLDER : FileKind.FILE, extraClasses });
}
......
......@@ -71,6 +71,7 @@ export class FileStat implements IFileStat {
public children: FileStat[];
public parent: FileStat;
public exists: boolean;
public isDirectoryResolved: boolean;
constructor(resource: URI, public root: FileStat, isDirectory?: boolean, hasChildren?: boolean, name: string = paths.basename(resource.fsPath), mtime?: number, etag?: string) {
......@@ -90,6 +91,7 @@ export class FileStat implements IFileStat {
}
this.isDirectoryResolved = false;
this.exists = true;
}
public getId(): string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册