提交 812814fc 编写于 作者: R Rik Smeets

Improve variable name

上级 23e64dda
......@@ -39,17 +39,17 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
// The token has to at least be contained in a concatenation of some form.
// The selected token has to at least be contained in a concatenation of some form.
// i.e. "goo" + a or 3 + 1 + "goo". However, those concats could be in larger
// concats as well. Walk to the top of that entire chain.
var literalExpression = token.Parent;
var top = literalExpression;
var selectedExpression = token.Parent;
var top = selectedExpression;
while (IsStringConcat(syntaxFacts, top.Parent, semanticModel, cancellationToken))
{
top = top.Parent;
}
if (top == literalExpression && !IsStringConcat(syntaxFacts, top, semanticModel, cancellationToken))
if (top == selectedExpression && !IsStringConcat(syntaxFacts, top, semanticModel, cancellationToken))
{
// We weren't in a concatenation at all.
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册