50 references to Modifiers
Microsoft.CodeAnalysis.CSharp (16)
Binder\Binder_Statements.cs (1)
600foreach (var modifier in node.Modifiers)
Binder\LocalBinderFactory.cs (1)
418binder = binder.SetOrClearUnsafeRegionIfNecessary(node.Modifiers,
Symbols\Source\LocalFunctionSymbol.cs (2)
52syntax.Modifiers.ToDeclarationModifiers(isForTypeDeclaration: false, diagnostics: _declarationDiagnostics); 62binder = binder.SetOrClearUnsafeRegionIfNecessary(syntax.Modifiers);
Syntax.xml.Main.Generated.cs (1)
1834=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), VisitToken(node.Identifier), (TypeParameterListSyntax?)Visit(node.TypeParameterList), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitList(node.ConstraintClauses), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken));
Syntax.xml.Syntax.Generated.cs (11)
6395if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || returnType != this.ReturnType || identifier != this.Identifier || typeParameterList != this.TypeParameterList || parameterList != this.ParameterList || constraintClauses != this.ConstraintClauses || body != this.Body || expressionBody != this.ExpressionBody || semicolonToken != this.SemicolonToken) 6406public new LocalFunctionStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6408public LocalFunctionStatementSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6409public LocalFunctionStatementSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6410public LocalFunctionStatementSyntax WithTypeParameterList(TypeParameterListSyntax? typeParameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, typeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6411public LocalFunctionStatementSyntax WithParameterList(ParameterListSyntax parameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, parameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6412public LocalFunctionStatementSyntax WithConstraintClauses(SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, constraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6413public LocalFunctionStatementSyntax WithBody(BlockSyntax? body) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, body, this.ExpressionBody, this.SemicolonToken); 6414public LocalFunctionStatementSyntax WithExpressionBody(ArrowExpressionClauseSyntax? expressionBody) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, expressionBody, this.SemicolonToken); 6415public LocalFunctionStatementSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, semicolonToken); 6419public LocalFunctionStatementSyntax AddModifiers(params SyntaxToken[] items) => WithModifiers(this.Modifiers.AddRange(items));
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
38if (localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
55if (statement.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
345case LocalFunctionStatementSyntax localFunction when localFunction.Modifiers.Any(SyntaxKind.StaticKeyword): 745LocalFunctionStatementSyntax localFunction => localFunction.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
155LocalFunctionStatementSyntax localFunc => localFunc.Modifiers,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
147LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
118localFunction.Modifiers,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
149TryGetReturnType(localFunction.ReturnType, localFunction.Modifiers, onYield),
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (1)
20var newModifiers = RemoveAsyncModifier(localFunction.Modifiers, ref returnType);
Microsoft.CodeAnalysis.CSharp.Features (16)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
343modifierGetter: f => f.Modifiers,
EditAndContinue\SyntaxComparer.cs (1)
1031modifiers = localFunction.Modifiers;
EditAndContinue\SyntaxUtilities.cs (1)
224LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword),
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
32LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword),
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
74LocalFunctionStatementSyntax localFunction => TryAddAsyncModifier(localFunction.Modifiers, spans),
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
143return localFunction != null && localFunction.Modifiers.Any(SyntaxKind.StaticKeyword);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
303if (localFunction is { Body: not null } && localFunction.Modifiers.Any(SyntaxKind.StaticKeyword)) 372if (localFunction != null && !localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
37if (localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
38if (localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
55if (statement.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
147LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
118localFunction.Modifiers,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
149TryGetReturnType(localFunction.ReturnType, localFunction.Modifiers, onYield),
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (1)
20var newModifiers = RemoveAsyncModifier(localFunction.Modifiers, ref returnType);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
184if (node is LocalFunctionStatementSyntax localFunction && localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Generated\Syntax.Test.xml.Generated.cs (2)
12396Assert.Equal(default, node.Modifiers); 12405var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithReturnType(node.ReturnType).WithIdentifier(node.Identifier).WithTypeParameterList(node.TypeParameterList).WithParameterList(node.ParameterList).WithConstraintClauses(node.ConstraintClauses).WithBody(node.Body).WithExpressionBody(node.ExpressionBody).WithSemicolonToken(node.SemicolonToken);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
525LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.Any(SyntaxKind.StaticKeyword),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
345case LocalFunctionStatementSyntax localFunction when localFunction.Modifiers.Any(SyntaxKind.StaticKeyword): 745LocalFunctionStatementSyntax localFunction => localFunction.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
155LocalFunctionStatementSyntax localFunc => localFunc.Modifiers,
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
345case LocalFunctionStatementSyntax localFunction when localFunction.Modifiers.Any(SyntaxKind.StaticKeyword): 745LocalFunctionStatementSyntax localFunction => localFunction.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
155LocalFunctionStatementSyntax localFunc => localFunc.Modifiers,