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