提交 833884ae 编写于 作者: I isidor

FileStat.isRoot helper method

上级 c65f1298
......@@ -545,11 +545,11 @@ export class FileSorter implements ISorter {
}
// Do not sort roots
if (statA.resource.toString() === statA.root.toString()) {
if (statA.isRoot) {
return -1;
}
if (statB.resource.toString() === statB.root.toString()) {
if (statB.isRoot) {
return 1;
}
......
......@@ -87,6 +87,10 @@ export class FileStat implements IFileStat {
return this.resource.toString();
}
public get isRoot(): boolean {
return this.resource.toString() === this.root.toString();
}
public static create(raw: IFileStat, root: URI, resolveTo?: URI[]): FileStat {
const stat = new FileStat(raw.resource, root, raw.isDirectory, raw.hasChildren, raw.name, raw.mtime, raw.etag);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册