提交 31dd1246 编写于 作者: Š Šimon Koníček

Renaming IsPureBlock to IsScopeBlock

上级 b64f7885
......@@ -62,7 +62,7 @@ private async Task<Document> RefactorAsync(Document document, TextSpan span, Can
// If our statements only contain a single block, walk down the block and any subsequent nested blocks
// to get the real statements inside.
while (statements.Count == 1 && syntaxFacts.IsPureBlock(statements[0]))
while (statements.Count == 1 && syntaxFacts.IsScopeBlock(statements[0]))
{
statements = syntaxFacts.GetExecutableBlockStatements(statements[0]);
}
......@@ -84,7 +84,7 @@ private async Task<Document> RefactorAsync(Document document, TextSpan span, Can
// }
while (statements.Count > 0 && statements[0].Parent is var parent &&
syntaxFacts.IsPureBlock(parent) &&
syntaxFacts.IsScopeBlock(parent) &&
syntaxFacts.GetExecutableBlockStatements(parent).Count == statements.Count)
{
statements = ImmutableArray.Create(parent);
......
......@@ -1880,7 +1880,7 @@ public SyntaxNode GetTypeOfVariableDeclarator(SyntaxNode node)
public SyntaxNode GetValueOfEqualsValueClause(SyntaxNode node)
=> ((EqualsValueClauseSyntax)node)?.Value;
public bool IsPureBlock(SyntaxNode node)
public bool IsScopeBlock(SyntaxNode node)
=> node.IsKind(SyntaxKind.Block);
public bool IsExecutableBlock(SyntaxNode node)
......
......@@ -326,7 +326,7 @@ internal interface ISyntaxFactsService : ILanguageService
/// <summary>
/// A block that has no semantics other than introducing a new scope. That is only C# BlockSyntax.
/// </summary>
bool IsPureBlock(SyntaxNode node);
bool IsScopeBlock(SyntaxNode node);
/// <summary>
/// A node that contains a list of statements. In C#, this is BlockSyntax and SwitchSectionSyntax.
......
......@@ -1812,7 +1812,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return DirectCast(node, EqualsValueSyntax).Value
End Function
Public Function IsPureBlock(node As SyntaxNode) As Boolean Implements ISyntaxFactsService.IsPureBlock
Public Function IsScopeBlock(node As SyntaxNode) As Boolean Implements ISyntaxFactsService.IsScopeBlock
' VB has no equivalent of curly braces.
Return False
End Function
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册