Skip to content

Commit

Permalink
Remove unused "IsLocalFunctionDeclarationContext" from CSharpSyntaxCo…
Browse files Browse the repository at this point in the history
…ntext
  • Loading branch information
MaStr11 committed Jul 19, 2021
1 parent 842a1f6 commit eb1b5be
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ namespace Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery
{
internal sealed class CSharpSyntaxContext : SyntaxContext
{
private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
{
SyntaxKind.ExternKeyword,
SyntaxKind.StaticKeyword,
SyntaxKind.AsyncKeyword,
SyntaxKind.UnsafeKeyword,
};

public readonly TypeDeclarationSyntax? ContainingTypeDeclaration;
public readonly BaseTypeDeclarationSyntax? ContainingTypeOrEnumDeclaration;

Expand Down Expand Up @@ -59,7 +51,6 @@ internal sealed class CSharpSyntaxContext : SyntaxContext
public readonly bool IsDestructorTypeContext;
public readonly bool IsLeftSideOfImportAliasDirective;
public readonly bool IsFunctionPointerTypeArgumentContext;
public readonly bool IsLocalFunctionDeclarationContext;

private CSharpSyntaxContext(
Workspace? workspace,
Expand Down Expand Up @@ -116,7 +107,6 @@ private CSharpSyntaxContext(
bool isRightSideOfNumericType,
bool isInArgumentList,
bool isFunctionPointerTypeArgumentContext,
bool isLocalFunctionDeclarationContext,
CancellationToken cancellationToken)
: base(workspace, semanticModel, position, leftToken, targetToken,
isTypeContext, isNamespaceContext, isNamespaceDeclarationNameContext,
Expand Down Expand Up @@ -158,7 +148,6 @@ private CSharpSyntaxContext(
this.IsDestructorTypeContext = isDestructorTypeContext;
this.IsLeftSideOfImportAliasDirective = isLeftSideOfImportAliasDirective;
this.IsFunctionPointerTypeArgumentContext = isFunctionPointerTypeArgumentContext;
this.IsLocalFunctionDeclarationContext = isLocalFunctionDeclarationContext;
}

public static CSharpSyntaxContext CreateContext(Workspace workspace, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
Expand Down Expand Up @@ -223,8 +212,6 @@ private static CSharpSyntaxContext CreateContextWorker(Workspace? workspace, Sem

var isArgumentListToken = targetToken.Parent.IsKind(SyntaxKind.ArgumentList, SyntaxKind.AttributeArgumentList, SyntaxKind.ArrayRankSpecifier);

var isLocalFunctionDeclarationContext = syntaxTree.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken);

return new CSharpSyntaxContext(
workspace: workspace,
semanticModel: semanticModel,
Expand Down Expand Up @@ -280,7 +267,6 @@ private static CSharpSyntaxContext CreateContextWorker(Workspace? workspace, Sem
isRightSideOfNumericType: isRightSideOfNumericType,
isInArgumentList: isArgumentListToken,
isFunctionPointerTypeArgumentContext: syntaxTree.IsFunctionPointerTypeArgumentContext(position, leftToken, cancellationToken),
isLocalFunctionDeclarationContext: isLocalFunctionDeclarationContext,
cancellationToken: cancellationToken);
}

Expand Down

0 comments on commit eb1b5be

Please sign in to comment.