提交 c474093b 编写于 作者: C Christian Alexander

Allow workspaceContains to specify directories (fixes #8295).

上级 9342ea6c
......@@ -193,6 +193,13 @@ export function fileExistsWithResult<T>(path: string, successResult: T): TPromis
});
}
export function existsWithResult<T>(path: string, successResult: T): TPromise<T> {
return exists(path).then((exists) => {
return exists ? successResult : null;
}, (err) => {
return TPromise.wrapError(err);
});
}
function removeNull<T>(arr: T[]): T[] {
return arr.filter(item => (item !== null));
......
......@@ -246,7 +246,7 @@ export class ExtensionHostMain {
return TPromise.join(
Object.keys(desiredFilesMap).map(
(fileName) => pfs.fileExistsWithResult(paths.join(folderPath, fileName), fileName)
(fileName) => pfs.existsWithResult(paths.join(folderPath, fileName), fileName)
)
).then((fileNames: string[]) => {
fileNames.forEach((existingFileName) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册