提交 c8f1f749 编写于 作者: C Cyrus Najmabadi

remove unnecessary option

上级 ddb6fb75
......@@ -316,15 +316,7 @@ private void RemoveMetadataReferences(ProjectId projectId)
}
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);
}
=> project.SupportsCompilation;
}
}
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.CodeAnalysis.Remote
{
internal static class RemoteFeatureOptions
{
public static bool ShouldComputeIndex(Workspace workspace)
{
switch (workspace.Kind)
{
case WorkspaceKind.Test:
// Always compute indices in tests.
return true;
case WorkspaceKind.RemoteWorkspace:
// Always compute indices in the remote workspace.
return true;
case WorkspaceKind.Host:
case WorkspaceKind.MSBuild:
// Compute indices in the host workspace when OOP is disabled.
var remoteHostClientService = workspace.Services.GetService<IRemoteHostClientService>();
if (remoteHostClientService is null)
{
return true;
}
return !remoteHostClientService.IsEnabled();
}
// Otherwise, don't compute the index for any other workspaces.
return false;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册