未验证 提交 0317628e 编写于 作者: D dotnet-automerge-bot 提交者: GitHub

Merge pull request #28904 from dotnet/merges/dev15.9.x-to-master

Merge dev15.9.x to master
......@@ -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
......
......@@ -6162,6 +6162,31 @@ End Class
End Using
End Sub
<WorkItem(25655, "https://github.com/dotnet/roslyn/issues/25655")>
<Fact, Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub RenameClassWithNoCompilationProjectReferencingProject()
Using result = RenameEngineResult.Create(_outputHelper,
<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 [|A|]()
{
}
}
</Document>
</Project>
</Workspace>, renameTo:="B")
End Using
End Sub
#Region "Rename in strings/comments"
<WorkItem(700923, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/700923"), WorkItem(700925, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/700925")>
......
......@@ -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,
......
......@@ -660,7 +660,7 @@ private async Task FindDocumentsAndPossibleNameConflicts()
foreach (var language in documentsFromAffectedProjects.Select(d => d.Project.Language).Distinct())
{
solution.Workspace.Services.GetLanguageServices(language).GetService<IRenameRewriterLanguageService>()
.TryAddPossibleNameConflicts(symbol, _replacementText, _possibleNameConflicts);
?.TryAddPossibleNameConflicts(symbol, _replacementText, _possibleNameConflicts);
}
await AddDocumentsWithPotentialConflicts(documentsFromAffectedProjects).ConfigureAwait(false);
......
......@@ -424,17 +424,21 @@ internal static async Task<IEnumerable<RenameLocation>> GetRenamableReferenceLoc
foreach (var documentsGroupedByLanguage in RenameUtilities.GetDocumentsAffectedByRename(originalSymbol, solution, renameLocations).GroupBy(d => d.Project.Language))
{
var syntaxFactsLanguageService = solution.Workspace.Services.GetLanguageServices(documentsGroupedByLanguage.Key).GetService<ISyntaxFactsService>();
foreach (var document in documentsGroupedByLanguage)
if (syntaxFactsLanguageService != null)
{
if (renameInStrings)
foreach (var document in documentsGroupedByLanguage)
{
await AddLocationsToRenameInStringsAsync(document, renameText, syntaxFactsLanguageService,
stringLocations, cancellationToken).ConfigureAwait(false);
}
if (renameInStrings)
{
await AddLocationsToRenameInStringsAsync(document, renameText, syntaxFactsLanguageService,
stringLocations, cancellationToken).ConfigureAwait(false);
}
if (renameInComments)
{
await AddLocationsToRenameInCommentsAsync(document, renameText, commentLocations, cancellationToken).ConfigureAwait(false);
if (renameInComments)
{
await AddLocationsToRenameInCommentsAsync(document, renameText, commentLocations, cancellationToken).ConfigureAwait(false);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册