Skip to content

Commit

Permalink
Update src/Features/Core/Portable/ConvertToInterpolatedString/Convert…
Browse files Browse the repository at this point in the history
…RegularStringToInterpolatedStringRefactoringProvider.cs
  • Loading branch information
CyrusNajmabadi authored Oct 14, 2020
1 parent f858da3 commit 05f7c19
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ private static SyntaxNode CreateInterpolatedString(Document document, SyntaxNode
private static Task<Document> UpdateDocumentAsync(Document document, SyntaxNode root, SyntaxToken token)
{
var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>();
var isVerbatim = syntaxFacts.IsVerbatimStringLiteral(token);
var literalExpression = token.GetRequiredParent();
var interpolatedString = CreateInterpolatedString(document, literalExpression, isVerbatim);
var newRoot = root.ReplaceNode(literalExpression, interpolatedString);
return Task.FromResult(document.WithSyntaxRoot(newRoot));
return Task.FromResult(document.WithSyntaxRoot(
root.ReplaceNode(
literalExpression,
CreateInterpolatedString(document, literalExpression, syntaxFacts.IsVerbatimStringLiteral(token)))));
}

private class MyCodeAction : CodeAction.DocumentChangeAction
Expand Down

0 comments on commit 05f7c19

Please sign in to comment.