提交 fc737a4a 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #19357 from CyrusNajmabadi/noTypeScriptIndices

Do not even attempt to create indices for non-C#/VB projects.
......@@ -4,7 +4,6 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Composition;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -13,7 +12,6 @@
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.NavigateTo;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.SolutionCrawler;
using Roslyn.Utilities;
......@@ -181,6 +179,12 @@ public override Task AnalyzeProjectAsync(Project project, bool semanticsChanged,
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 (project.Solution.Workspace.Kind != "Test" &&
project.Solution.Workspace.Kind != WorkspaceKind.RemoteWorkspace &&
project.Solution.Workspace.Options.GetOption(NavigateToOptions.OutOfProcessAllowed))
......
......@@ -21,6 +21,12 @@ private class IncrementalAnalyzer : IncrementalAnalyzerBase
{
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 SpecializedTasks.EmptyTask;
}
if (document.Project.Solution.Workspace.Kind != WorkspaceKind.RemoteWorkspace &&
document.Project.Solution.Workspace.Options.GetOption(SymbolFinderOptions.OutOfProcessAllowed))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册