fix projects notification showing when it shouldn't (#15890)

* fix projects notification showing when it shouldn't

* use path.resolve
This commit is contained in:
Kim Santiago
2021-06-24 12:24:57 -07:00
committed by GitHub
parent ae7e69381a
commit 8c6be27254
2 changed files with 12 additions and 6 deletions

View File

@@ -218,6 +218,11 @@ export class WorkspaceService implements IWorkspaceService {
}
}
/**
* Returns an array of all the supported projects in the folder
* @param folder folder to look look for projects
* @returns array of file paths of supported projects
*/
async getAllProjectsInFolder(folder: vscode.Uri): Promise<string[]> {
// get the unique supported project extensions
const supportedProjectExtensions = [...new Set((await this.getAllProjectTypes()).map(p => { return p.projectFileExtension; }))];
@@ -229,7 +234,8 @@ export class WorkspaceService implements IWorkspaceService {
// so the filter needs to be in the format folder/**/*.sqlproj if there's only one supported projectextension
const projFilter = supportedProjectExtensions.length > 1 ? path.posix.join(escapedPath, '**', `*.{${supportedProjectExtensions.toString()}}`) : path.posix.join(escapedPath, '**', `*.${supportedProjectExtensions[0]}`);
return await glob(projFilter);
// glob will return an array of file paths with forward slashes, so they need to be converted back if on windows
return (await glob(projFilter)).map(p => path.resolve(p));
}
async getProjectProvider(projectFile: vscode.Uri): Promise<dataworkspace.IProjectProvider | undefined> {