84 references to ConstKeyword
Microsoft.CodeAnalysis.CSharp (21)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
109
Debug.Assert(!modifiers.Any(SyntaxKind.
ConstKeyword
)); // const locals don't have a sequence point
Parser\LanguageParser.cs (9)
2307
case SyntaxKind.
ConstKeyword
:
2582
if (this.CurrentToken.Kind == SyntaxKind.
ConstKeyword
)
3062
if (this.CurrentToken.Kind == SyntaxKind.
ConstKeyword
)
5128
if (mods.Any(SyntaxKind.
ConstKeyword
))
5438
modifiers.Add(this.EatToken(SyntaxKind.
ConstKeyword
));
8766
case SyntaxKind.
ConstKeyword
:
10222
if (mods.Any((int)SyntaxKind.
ConstKeyword
))
10333
case SyntaxKind.
ConstKeyword
:
10613
case SyntaxKind.
ConstKeyword
:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
893
AddKeyword(SyntaxKind.
ConstKeyword
);
Symbols\Source\ModifierUtils.cs (2)
302
return SyntaxFacts.GetText(SyntaxKind.
ConstKeyword
);
366
case SyntaxKind.
ConstKeyword
:
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2793
!ContainsModifier(fieldDecl.Modifiers, SyntaxKind.
ConstKeyword
);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
75
if (modifier.Kind() == SyntaxKind.
ConstKeyword
)
81
Debug.Assert(constToken.Kind() == SyntaxKind.
ConstKeyword
);
Syntax\DeclarationStatementSyntax.cs (1)
13
return this.Modifiers.Any(SyntaxKind.
ConstKeyword
);
Syntax\SyntaxEquivalence.cs (2)
171
var isConstBefore = fieldBefore.Modifiers.Any((int)SyntaxKind.
ConstKeyword
);
172
var isConstAfter = fieldAfter.Modifiers.Any((int)SyntaxKind.
ConstKeyword
);
Syntax\SyntaxKindFacts.cs (2)
945
return SyntaxKind.
ConstKeyword
;
1593
case SyntaxKind.
ConstKeyword
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
24
public static readonly SyntaxToken ConstKeyword = Token(SyntaxKind.
ConstKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
136
SyntaxKind.
ConstKeyword
=> DeclarationModifiers.Const,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
381
=> BothHaveModifier(x, y, SyntaxKind.
ConstKeyword
, out comparisonResult);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
29
.Where(f => f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
34
if (fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
))
44
.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
729
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
1785
if (token.IsKind(SyntaxKind.
ConstKeyword
) &&
2084
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
2091
return localDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.CSharp.Features (25)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
575
case SyntaxKind.
ConstKeyword
:
Completion\KeywordRecommenders\BoolKeywordRecommender.cs (1)
42
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\ByteKeywordRecommender.cs (1)
43
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\CharKeywordRecommender.cs (1)
42
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\ConstKeywordRecommender.cs (1)
32
: base(SyntaxKind.
ConstKeyword
)
Completion\KeywordRecommenders\DecimalKeywordRecommender.cs (1)
42
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\DoubleKeywordRecommender.cs (1)
42
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
55
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\FloatKeywordRecommender.cs (1)
42
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\IntKeywordRecommender.cs (1)
38
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\LongKeywordRecommender.cs (1)
43
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\ObjectKeywordRecommender.cs (1)
42
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\RequiredKeywordRecommender.cs (1)
16
private static readonly ISet<SyntaxKind> s_validModifiers = SyntaxKindSet.AllMemberModifiers.Where(s => s is not (SyntaxKind.RequiredKeyword or SyntaxKind.StaticKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.
ConstKeyword
)).ToSet();
Completion\KeywordRecommenders\SByteKeywordRecommender.cs (1)
43
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\ShortKeywordRecommender.cs (1)
43
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\StringKeywordRecommender.cs (1)
44
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\UIntKeywordRecommender.cs (1)
43
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\ULongKeywordRecommender.cs (1)
43
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
Completion\KeywordRecommenders\UShortKeywordRecommender.cs (1)
50
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
EditAndContinue\BreakpointSpans.cs (3)
792
if (modifiersOpt.Any(SyntaxKind.
ConstKeyword
))
832
if (variableDeclarator.Initializer == null || modifiers.Any(SyntaxKind.
ConstKeyword
))
853
if (variableDeclarator.Initializer == null || modifiers.Any(SyntaxKind.
ConstKeyword
))
EditAndContinue\SyntaxUtilities.cs (1)
56
when !fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
)
ExtractMethod\Extensions.cs (1)
128
if (!modifiersGetter(decl).Any(SyntaxKind.
ConstKeyword
))
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
161
=> member is FieldDeclarationSyntax field && field.Modifiers.Any(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
Parsing\AwaitParsingTests.cs (1)
2500
N(SyntaxKind.
ConstKeyword
);
Parsing\DeclarationParsingTests.cs (1)
3836
Assert.Equal(SyntaxKind.
ConstKeyword
, fs.Modifiers[0].Kind());
Parsing\DeclarationScopeParsingTests.cs (4)
13613
N(SyntaxKind.
ConstKeyword
);
13683
N(SyntaxKind.
ConstKeyword
);
13988
N(SyntaxKind.
ConstKeyword
);
14052
N(SyntaxKind.
ConstKeyword
);
Parsing\RecordParsing.cs (1)
3960
N(SyntaxKind.
ConstKeyword
);
Parsing\RefFieldParsingTests.cs (1)
364
N(SyntaxKind.
ConstKeyword
);
Parsing\StatementAttributeParsingTests.cs (1)
6825
N(SyntaxKind.
ConstKeyword
);
Parsing\StatementParsingTests.cs (1)
652
Assert.Equal(SyntaxKind.
ConstKeyword
, ds.Modifiers[0].Kind());
Parsing\TopLevelStatementsParsingTests.cs (1)
1980
N(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
Classification\ClassificationHelpers.cs (2)
239
FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
) ? ClassificationTypeNames.ConstantName : ClassificationTypeNames.FieldName,
322
if (parentNode.GetModifiers().Any(SyntaxKind.
ConstKeyword
))
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
388
: fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
24
public static readonly SyntaxToken ConstKeyword = Token(SyntaxKind.
ConstKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
136
SyntaxKind.
ConstKeyword
=> DeclarationModifiers.Const,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
381
=> BothHaveModifier(x, y, SyntaxKind.
ConstKeyword
, out comparisonResult);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
29
.Where(f => f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
34
if (fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
))
44
.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
729
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
1785
if (token.IsKind(SyntaxKind.
ConstKeyword
) &&
2084
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
2091
return localDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
741
yield return CS.SyntaxFactory.Token(CS.SyntaxKind.
ConstKeyword
);
Microsoft.ML.InternalCodeAnalyzer (1)
NameAnalyzer.cs (1)
151
if (mod.IsKind(SyntaxKind.
ConstKeyword
))
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\ModifierFlagsExtensions.cs (2)
31
{ ModifierFlags.Const, SyntaxKind.
ConstKeyword
},
82
case SyntaxKind.
ConstKeyword
: