Corrects workspace project tree refresh behavior for adding new projects to the workspace (#16650)

* bugfix and updates

* PR feedback

* Deferred promise for project disk scan

* fix casing

* fixing race condition on extension activation, test failure
This commit is contained in:
Benjin Dubishar
2021-08-11 09:11:00 -07:00
committed by GitHub
parent 998c838d8f
commit d0bcba4cc0
12 changed files with 134 additions and 65 deletions

View File

@@ -597,7 +597,7 @@ describe('ProjectsController', function (): void {
const project2 = await Project.openProject(vscode.Uri.file(projPath2).fsPath);
const showErrorMessageSpy = sinon.spy(vscode.window, 'showErrorMessage');
const dataWorkspaceMock = TypeMoq.Mock.ofType<dataworkspace.IExtension>();
dataWorkspaceMock.setup(x => x.getProjectsInWorkspace(TypeMoq.It.isAny())).returns(() => Promise.resolve([vscode.Uri.file(project1.projectFilePath), vscode.Uri.file(project2.projectFilePath)]));
dataWorkspaceMock.setup(x => x.getProjectsInWorkspace(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => Promise.resolve([vscode.Uri.file(project1.projectFilePath), vscode.Uri.file(project2.projectFilePath)]));
sinon.stub(vscode.extensions, 'getExtension').returns(<any>{ exports: dataWorkspaceMock.object });
// add project reference from project1 to project2