88 references to ConstKeyword
Microsoft.CodeAnalysis.CSharp (21)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
128
Debug.Assert(!modifiers.Any(SyntaxKind.
ConstKeyword
)); // const locals don't have a sequence point
Parser\LanguageParser.cs (9)
1992
case SyntaxKind.
ConstKeyword
:
2267
if (this.CurrentToken.Kind == SyntaxKind.
ConstKeyword
)
2747
if (this.CurrentToken.Kind == SyntaxKind.
ConstKeyword
)
4850
if (mods.Any(SyntaxKind.
ConstKeyword
))
5160
modifiers.Add(this.EatToken(SyntaxKind.
ConstKeyword
));
8212
case SyntaxKind.
ConstKeyword
:
9610
if (mods.Any((int)SyntaxKind.
ConstKeyword
))
9717
case SyntaxKind.
ConstKeyword
:
9997
case SyntaxKind.
ConstKeyword
:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
903
AddKeyword(SyntaxKind.
ConstKeyword
);
Symbols\Source\ModifierUtils.cs (2)
303
return SyntaxFacts.GetText(SyntaxKind.
ConstKeyword
);
367
case SyntaxKind.
ConstKeyword
:
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2660
!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)
144
var isConstBefore = fieldBefore.Modifiers.Any((int)SyntaxKind.
ConstKeyword
);
145
var isConstAfter = fieldAfter.Modifiers.Any((int)SyntaxKind.
ConstKeyword
);
Syntax\SyntaxKindFacts.cs (2)
917
return SyntaxKind.
ConstKeyword
;
1557
case SyntaxKind.
ConstKeyword
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
CSharpAccessibilityFacts.cs (1)
136
SyntaxKind.
ConstKeyword
=> DeclarationModifiers.Const,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
CSharpDeclarationComparer.cs (1)
381
=> BothHaveModifier(x, y, SyntaxKind.
ConstKeyword
, out comparisonResult);
CSharpSyntaxGeneratorInternal.cs (1)
39
isConst ? SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.
ConstKeyword
)) : default,
FieldGenerator.cs (4)
26
.Where(f => f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
31
if (fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
))
41
.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
127
tokens.Add(SyntaxFactory.Token(SyntaxKind.
ConstKeyword
));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (4)
727
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
1769
if (token.IsKind(SyntaxKind.
ConstKeyword
) &&
2075
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
2082
return localDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.CSharp.Features (27)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
589
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)
43
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)
46
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 (2)
611
if (modifiersOpt.Any(SyntaxKind.
ConstKeyword
))
656
if (modifiersOpt.Any(SyntaxKind.
ConstKeyword
))
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
241
if (fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
))
2006
return declaration.Modifiers.Any(SyntaxKind.
ConstKeyword
) ? FeaturesResources.const_field : FeaturesResources.field;
ExtractMethod\Extensions.cs (1)
134
if (!modifiersGetter(decl).Any(t => t.Kind() == SyntaxKind.
ConstKeyword
))
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
159
=> member is FieldDeclarationSyntax field && field.Modifiers.Any(SyntaxKind.
ConstKeyword
);
187
return SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.
ConstKeyword
));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
40
? SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.
ConstKeyword
))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
Parsing\AwaitParsingTests.cs (1)
1807
N(SyntaxKind.
ConstKeyword
);
Parsing\DeclarationParsingTests.cs (1)
3836
Assert.Equal(SyntaxKind.
ConstKeyword
, fs.Modifiers[0].Kind());
Parsing\DeclarationScopeParsingTests.cs (4)
14024
N(SyntaxKind.
ConstKeyword
);
14094
N(SyntaxKind.
ConstKeyword
);
14399
N(SyntaxKind.
ConstKeyword
);
14463
N(SyntaxKind.
ConstKeyword
);
Parsing\RecordParsing.cs (1)
3810
N(SyntaxKind.
ConstKeyword
);
Parsing\RefFieldParsingTests.cs (1)
364
N(SyntaxKind.
ConstKeyword
);
Parsing\StatementAttributeParsingTests.cs (1)
6813
N(SyntaxKind.
ConstKeyword
);
Parsing\StatementParsingTests.cs (1)
652
Assert.Equal(SyntaxKind.
ConstKeyword
, ds.Modifiers[0].Kind());
Parsing\TopLevelStatementsParsingTests.cs (1)
1977
N(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
Classification\ClassificationHelpers.cs (2)
241
FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
) ? ClassificationTypeNames.ConstantName : ClassificationTypeNames.FieldName,
324
if (parentNode.GetModifiers().Any(SyntaxKind.
ConstKeyword
))
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1715
list.Add(SyntaxFactory.Token(SyntaxKind.
ConstKeyword
));
CSharpAccessibilityFacts.cs (1)
136
SyntaxKind.
ConstKeyword
=> DeclarationModifiers.Const,
CSharpDeclarationComparer.cs (1)
381
=> BothHaveModifier(x, y, SyntaxKind.
ConstKeyword
, out comparisonResult);
CSharpSyntaxGeneratorInternal.cs (1)
39
isConst ? SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.
ConstKeyword
)) : default,
FieldGenerator.cs (4)
26
.Where(f => f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
31
if (fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
))
41
.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.
ConstKeyword
))
127
tokens.Add(SyntaxFactory.Token(SyntaxKind.
ConstKeyword
));
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
389
: fieldDeclaration.Modifiers.Any(m => m.Kind() == SyntaxKind.
ConstKeyword
)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (4)
727
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ConstKeyword
, cancellationToken) ||
1769
if (token.IsKind(SyntaxKind.
ConstKeyword
) &&
2075
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
2082
return localDeclaration.Modifiers.Any(SyntaxKind.
ConstKeyword
);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
755
yield return CS.SyntaxFactory.Token(CS.SyntaxKind.
ConstKeyword
);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\ModifierFlagsExtensions.cs (2)
32
{ ModifierFlags.Const, SyntaxKind.
ConstKeyword
},
83
case SyntaxKind.
ConstKeyword
: