本文整理汇总了C#中SolutionCrawlerRegistrationService.Reanalyze方法的典型用法代码示例。如果您正苦于以下问题:C# SolutionCrawlerRegistrationService.Reanalyze方法的具体用法?C# SolutionCrawlerRegistrationService.Reanalyze怎么用?C# SolutionCrawlerRegistrationService.Reanalyze使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolutionCrawlerRegistrationService
的用法示例。
在下文中一共展示了SolutionCrawlerRegistrationService.Reanalyze方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Document_Reanalyze
public async Task Document_Reanalyze()
{
using (var workspace = new WorkCoordinatorWorkspace(SolutionCrawler))
{
var solution = GetInitialSolutionInfo(workspace);
workspace.OnSolutionAdded(solution);
await WaitWaiterAsync(workspace.ExportProvider);
var info = solution.Projects[0].Documents[0];
var worker = new Analyzer();
var lazyWorker = new Lazy<IIncrementalAnalyzerProvider, IncrementalAnalyzerProviderMetadata>(() => new AnalyzerProvider(worker), Metadata.Crawler);
var service = new SolutionCrawlerRegistrationService(new[] { lazyWorker }, GetListeners(workspace.ExportProvider));
service.Register(workspace);
// don't rely on background parser to have tree. explicitly do it here.
await TouchEverything(workspace.CurrentSolution);
service.Reanalyze(workspace, worker, projectIds: null, documentIds: SpecializedCollections.SingletonEnumerable<DocumentId>(info.Id), highPriority: false);
await TouchEverything(workspace.CurrentSolution);
await WaitAsync(service, workspace);
service.Unregister(workspace);
Assert.Equal(1, worker.SyntaxDocumentIds.Count);
Assert.Equal(1, worker.DocumentIds.Count);
}
}
示例2: Document_Reanalyze
public void Document_Reanalyze()
{
using (var workspace = new TestWorkspace(TestExportProvider.CreateExportProviderWithCSharpAndVisualBasic(), SolutionCrawler))
{
var solution = GetInitialSolutionInfo(workspace);
workspace.OnSolutionAdded(solution);
WaitWaiter(workspace.ExportProvider);
var info = solution.Projects[0].Documents[0];
var worker = new Analyzer();
var lazyWorker = new Lazy<IIncrementalAnalyzerProvider, IncrementalAnalyzerProviderMetadata>(() => new AnalyzerProvider(worker), Metadata.Crawler);
var service = new SolutionCrawlerRegistrationService(new[] { lazyWorker }, GetListeners(workspace.ExportProvider));
service.Register(workspace);
// don't rely on background parser to have tree. explicitly do it here.
TouchEverything(workspace.CurrentSolution);
service.Reanalyze(workspace, worker, projectIds: null, documentIds: SpecializedCollections.SingletonEnumerable<DocumentId>(info.Id));
TouchEverything(workspace.CurrentSolution);
Wait(service, workspace);
service.Unregister(workspace);
Assert.Equal(1, worker.SyntaxDocumentIds.Count);
Assert.Equal(1, worker.DocumentIds.Count);
}
}