void UpdateCommentTagsForProject (Solution solution, Project project, CancellationToken token) { if (token.IsCancellationRequested) return; ProjectCommentTags tags; if (!projectTags.TryGetValue (project, out tags)) { tags = new ProjectCommentTags (); projectTags [project] = tags; } var files = project.Files.ToArray (); Task.Run (async () => { try { await tags.UpdateAsync (project, files, token); } catch (TaskCanceledException) { } catch (AggregateException ae) { ae.Flatten ().Handle (x => x is TaskCanceledException); } catch (Exception e) { LoggingService.LogError ("Error while updating comment tags.", e); } }); }
void LoadSolutionContents (Solution sln) { loadedSlns.Add (sln); System.Threading.ThreadPool.QueueUserWorkItem (delegate { // Load all tags that are stored in pidb files foreach (Project p in sln.GetAllProjects ()) { var pContext = TypeSystemService.GetProjectContentWrapper (p); if (pContext == null) { continue; } var tags = pContext.GetExtensionObject<ProjectCommentTags> (); if (tags == null) { tags = new ProjectCommentTags (); pContext.UpdateExtensionObject (tags); tags.Update (pContext.Project); } else { foreach (var kv in tags.Tags) { UpdateCommentTags (sln, kv.Key, kv.Value); } } } }); }
void UpdateCommentTagsForProject(Solution solution, Project project) { var ctx = TypeSystemService.GetProjectContentWrapper (project); if (ctx == null) return; var tags = ctx.GetExtensionObject<ProjectCommentTags> (); if (tags == null) { tags = new ProjectCommentTags (); ctx.UpdateExtensionObject (tags); tags.Update (ctx.Project); } else { foreach (var kv in tags.Tags) { UpdateCommentTags (solution, kv.Key, kv.Value); } } }