提交 9daa5c18 编写于 作者: R Ravi Chande

CR feedback

上级 b1398cf1
......@@ -2666,7 +2666,7 @@ public class Class1
</Project>
</Workspace>");
// P3 has a P2P ref to Project P2 and uses the type "Missing" from P2
// P3 has a project ref to Project P2 and uses the type "Missing" from P2
// as the return type of a virtual method.
// P1 has a metadata reference to P3 and therefore doesn't get the transitive
// reference to P2. If we try to override Goo, the missing "Missing" type will
......@@ -2675,10 +2675,9 @@ public class Class1
{
var compilation = await workspace.CurrentSolution.Projects.First(p => p.Name == "P3").GetCompilationAsync();
// CompilationExtensions is in the MS.CA.Test.Utilities namespace which has a "Traits" type that conflicts with the one in
// Roslyn.Test.Utilities
// CompilationExtensions is in the Microsoft.CodeAnalysis.Test.Utilities namespace
// which has a "Traits" type that conflicts with the one in Roslyn.Test.Utilities
var reference = MetadataReference.CreateFromImage(Test.Utilities.CompilationExtensions.EmitToArray(compilation));
var p1 = workspace.CurrentSolution.Projects.First(p => p.Name == "P1");
var updatedP1 = p1.AddMetadataReference(reference);
workspace.ChangeSolution(updatedP1.Solution);
......
......@@ -104,7 +104,9 @@ private async Task<Document> DetermineNewDocumentAsync(Document document, Comple
var memberContainingDocument = await GenerateMemberAndUsingsAsync(document, completionItem, line, cancellationToken).ConfigureAwait(false);
if (memberContainingDocument == null)
{
// Generating the new document failed, return no changes.
// Generating the new document failed because we somehow couldn't resolve
// the underlying symbol's SymbolKey. At this point, we won't be able to
// make any changes, so just return the document we started with.
return document;
}
......@@ -141,7 +143,7 @@ private async Task<Document> DetermineNewDocumentAsync(Document document, Comple
if (overriddenMember == null)
{
// Unfortunately, SymbolKey resolution failed. We have to bail.
// Unfortunately, SymbolKey resolution failed. Bail.
return null;
}
......
......@@ -91,13 +91,13 @@ internal async Task<IEnumerable<CompletionItem>> GetItemsAsync()
overridableMembers = _provider.FilterOverrides(overridableMembers, returnType);
var symbolDisplayService = _document.GetLanguageService<ISymbolDisplayService>();
var resolvableMembers = overridableMembers.Where(m => CanSerializeSymbolKey(m, semanticModel.Compilation));
var resolvableMembers = overridableMembers.Where(m => CanResolveSymbolKey(m, semanticModel.Compilation));
return overridableMembers.Select(m => CreateItem(
m, symbolDisplayService, semanticModel, startToken, modifiers)).ToList();
}
private bool CanSerializeSymbolKey(ISymbol m, Compilation compilation)
private bool CanResolveSymbolKey(ISymbol m, Compilation compilation)
{
// SymbolKey doesn't guarantee roundtrip-ability, which we need in order to generate overrides.
// Preemptively filter out those methods whose SymbolKeys we won't be able to round trip.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册