Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDavid Karlaš <david.karlas@microsoft.com>2019-07-18 21:09:18 +0300
committerGitHub <noreply@github.com>2019-07-18 21:09:18 +0300
commitc6d6d59c2c4797f6b7e74129c692feb350131407 (patch)
tree38a762f292dc5f5dc51640647de6aa6c2e47148a /main
parent01d3b0da719e10ae3385a8792234f440e2176685 (diff)
parentad32fc411e984eb188254ceef2f32730064727e0 (diff)
Merge pull request #8222 from mono/pr-david-fixGetCodeAnalysisProjectAsync
Make `TypeSystemService.GetCodeAnalysisProjectAsync` return actual value when solution is still loading
Diffstat (limited to 'main')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs
index f77ef9a3ed..f35f5ac560 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs
@@ -431,18 +431,22 @@ namespace MonoDevelop.Ide.TypeSystem
var parentSolution = project.ParentSolution;
var workspace = await GetWorkspaceAsync (parentSolution, cancellationToken);
var projectId = workspace.GetProjectId (project);
- if (projectId == null)
- return null;
- var proj = workspace.CurrentSolution.GetProject (projectId);
- if (proj != null)
- return proj;
+ Microsoft.CodeAnalysis.Project proj = null;
+ if (projectId != null) {
+ proj = workspace.CurrentSolution.GetProject (projectId);
+ if (proj != null)
+ return proj;
+ }
//We assume that since we have projectId and project is not found in solution
//project is being loaded(waiting MSBuild to return list of source files)
var taskSource = new TaskCompletionSource<Microsoft.CodeAnalysis.Project> ();
var registration = cancellationToken.Register (() => taskSource.TrySetCanceled ());
EventHandler<WorkspaceChangeEventArgs> del = (s, e) => {
if (e.Kind == WorkspaceChangeKind.SolutionAdded || e.Kind == WorkspaceChangeKind.SolutionReloaded) {
- proj = workspace.CurrentSolution.GetProject (projectId);
+ projectId = workspace.GetProjectId (project);
+ if (projectId == null)
+ return;
+ var proj = workspace.CurrentSolution.GetProject (projectId);
if (proj != null) {
registration.Dispose ();
taskSource.TrySetResult (proj);