private bool SupportAnalysis(Project project) { if (!project.SupportsCompilation) { // Not a language we can produce indices for (i.e. TypeScript). Bail immediately. return(false); } return(RemoteFeatureOptions.ShouldComputeIndex(project.Solution.Workspace)); }
public override Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) { if (!document.SupportsSyntaxTree) { // Not a language we can produce indices for (i.e. TypeScript). Bail immediately. return(Task.CompletedTask); } if (!RemoteFeatureOptions.ShouldComputeIndex(document.Project.Solution.Workspace)) { return(Task.CompletedTask); } return(SyntaxTreeIndex.PrecalculateAsync(document, cancellationToken)); }
private async Task UpdateSymbolTreeInfoAsync(Project project, CancellationToken cancellationToken) { if (!project.SupportsCompilation) { // Not a language we can produce indices for (i.e. TypeScript). Bail immediately. return; } if (!RemoteFeatureOptions.ShouldComputeIndex(project.Solution.Workspace)) { return; } // Produce the indices for the source and metadata symbols in parallel. var projectTask = UpdateSourceSymbolTreeInfoAsync(project, cancellationToken); var referencesTask = UpdateReferencesAync(project, cancellationToken); await Task.WhenAll(projectTask, referencesTask).ConfigureAwait(false); }