提交 0a34c068 编写于 作者: J Jason Malinowski

Update DependentProjectsFinder to only return projects supporting compilations

AddNonSubmissionDependentProjectsAsync is designed to return projects
that depend on a given symbol. It indirectly calls HasReferenceTo
which in the metadata paths will only return projects that have
Compilation support. Thus, it seems safe to exclude the projects
entirely.

Fixes dotnet/roslyn#25655.
上级 f2e96763
......@@ -788,6 +788,31 @@ class Program
}
</Document>
</Project>
</Workspace>
Await TestAPIAndFeature(input)
End Function
<WorkItem(25655, "https://github.com/dotnet/roslyn/issues/25655")>
<WpfFact, Trait(Traits.Feature, Traits.Features.FindReferences)>
Public Async Function TestNoCompilationProjectReferencingCSharp() As Task
Dim input =
<Workspace>
<Project Language="NoCompilation" CommonReferences="false">
<ProjectReference>CSharpProject</ProjectReference>
<Document>
// a no-compilation document
</Document>
</Project>
<Project Language="C#" AssemblyName="CSharpProject" CommonReferences="true">
<Document>
public class A
{
public {|Definition:$$A|}()
{
}
}
</Document>
</Project>
</Workspace>
Await TestAPIAndFeature(input)
End Function
......
......@@ -310,7 +310,7 @@ private static async Task AddNonSubmissionDependentProjectsAsync(IAssemblySymbol
cancellationToken.ThrowIfCancellationRequested();
if (HasReferenceTo(sourceAssembly, sourceProject, project, cancellationToken))
if (project.SupportsCompilation && HasReferenceTo(sourceAssembly, sourceProject, project, cancellationToken))
{
var hasInternalsAccess = await HasInternalsAccessAsync(
sourceAssembly, internalsVisibleToMap,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册