My CodeFix returns a Document and I can trace it through Roslyn until GetChangeSolutionAsync. When I view in debugger ChangedDocument has a Document with the correct text. But the next line compares ChangedDocument == null and it is null and exits the routine returning null instead of my document.
I have stepped through GetChangedSoultionAsync and see it returning the correct value in the debugger but then see it return with null
protected async virtual Task<Solution> GetChangedSolutionAsync(CancellationToken cancellationToken)
{
var changedDocument = await GetChangedDocumentAsync(cancellationToken).ConfigureAwait(false);
if (changedDocument == null)
{
return null;
}
return changedDocument.Project.Solution;
}
In debugger changedDocument after the await is shown below
?changedDocument Test0.vb DocumentState: {Microsoft.CodeAnalysis.DocumentState} FilePath: null Id: (DocumentId, #860a1da9-991f-4262-9428-c50c7a9a912e - Test0.vb) Name: "Test0.vb" Project: TestProject Services: {Microsoft.CodeAnalysis.DefaultTextDocumentServiceProvider} SourceCodeKind: Regular State: {Microsoft.CodeAnalysis.DocumentState} But the if statement is true and the function returns null