public AddProject ( VBProject project ) : void | ||
project | VBProject | |
return | void |
/// <summary> /// For the use of tests only /// </summary> public void Parse() { if (_state.Projects.Count == 0) { foreach (var project in _vbe.VBProjects.UnprotectedProjects()) { _state.AddProject(project); } } var components = new List <VBComponent>(); foreach (var project in _state.Projects) { foreach (VBComponent component in project.VBComponents) { components.Add(component); } } SyncComReferences(_state.Projects); foreach (var component in components) { _state.SetModuleState(component, ParserState.Pending); } // invalidation cleanup should go into ParseAsync? foreach (var key in _componentAttributes.Keys) { if (!components.Contains(key)) { _componentAttributes.Remove(key); } } var parseTasks = new Task[components.Count]; for (var i = 0; i < components.Count; i++) { parseTasks[i] = ParseAsync(components[i], CancellationToken.None); } Task.WaitAll(parseTasks); if (_state.Status != ParserState.Error) { Logger.Trace("Starting resolver task"); Resolve(_central.Token); // Tests expect this to be synchronous } }