提交 02d72406 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #9394 from ChristianAlexander/workspace-contains-directory

Allow workspaceContains to specify directories (fixes #8295).
......@@ -199,6 +199,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.
先完成此消息的编辑!
想要评论请 注册