[mono/monodevelop] 700f27db: Fixed 'Bug 16192 - Semantic highlighting marks things with red colour

Mike Krüger ([email protected]) <[email protected]> Thu, 14 Nov 2013 05:58:33 +0000
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <0000014255308825-70bdb109-9aab-4aae-ac10-7cfc6ca9b043-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/monodevelop
  Compare: https://github.com/mono/monodevelop/compare/8ffeb7c72001...700f27dbca58

   Commit: 700f27dbca58ddeacaead1a79111036b4ee6dd12
   Author: Mike Krüger <[email protected]> (mkrueger)
     Date: 2013-11-14 05:57:13 GMT
      URL: https://github.com/mono/monodevelop/commit/700f27dbca58ddeacaead1a79111036b4ee6dd12

Fixed 'Bug 16192 - Semantic highlighting marks things with red colour
while it is analyzing'.

Changed paths:
  M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
  M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs

Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
===================================================================
@@ -804,7 +804,7 @@ public ParsedDocument UpdateParseDocument ()
 			get {
 				if (currentWrapper == null)
 					return false;
-				return currentWrapper.InLoad || !currentWrapper.ReferencesConnected;
+				return !currentWrapper.IsLoaded || !currentWrapper.ReferencesConnected;
 			}
 		}
 

Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
===================================================================
@@ -951,6 +951,20 @@ static bool GetReferencesConnected (ProjectContentWrapper pcw, HashSet<ProjectCo
 				return pcw.referencesConnected && pcw.referencedWrappers.All (w => GetReferencesConnected (w, wrapper));
 			}
 
+			public bool IsLoaded {
+				get {
+					return GetIsLoaded (this, new HashSet<ProjectContentWrapper> ());
+				}
+			}
+
+			static bool GetIsLoaded (ProjectContentWrapper pcw, HashSet<ProjectContentWrapper> wrapper)
+			{
+				if (wrapper.Contains (pcw))
+					return true;
+				wrapper.Add (pcw); 
+				return !pcw.InLoad && pcw.referencedWrappers.All (w => GetIsLoaded (w, wrapper));
+			}
+
 			public IProjectContent Content {
 				get {
 					if (!referencesConnected) {
@@ -2600,6 +2614,7 @@ static void QueueParseJob (ProjectContentWrapper context, IEnumerable<ProjectFil
 			};
 			lock (parseQueueLock) {
 				RemoveParseJob (context);
+				context.LoadOperationDepth++;
 				parseQueueIndex [context] = job;
 				parseQueue.Enqueue (job);
 				parseEvent.Set ();
@@ -2637,17 +2652,7 @@ static void RemoveParseJob (ProjectContentWrapper project)
 				ParsingJob job;
 				if (parseQueueIndex.TryGetValue (project, out job)) {
 					parseQueueIndex.Remove (project);
-				}
-			}
-		}
-
-		static void RemoveParseJobs (IProjectContent context)
-		{
-			lock (parseQueueLock) {
-				foreach (var pj in parseQueue) {
-					if (pj.Context == context) {
-						parseQueueIndex.Remove (pj.Context);
-					}
+					project.LoadOperationDepth--;
 				}
 			}
 		}
@@ -2814,6 +2819,8 @@ static void ConsumeParsingQueue ()
 							if (monitor == null)
 								monitor = GetParseProgressMonitor ();
 							monitor.ReportError (null, ex);
+						} finally {
+							job.Context.LoadOperationDepth--;
 						}
 					}
 					
_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches