85 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)
2436case SyntaxKind.ConstKeyword: 2722if (this.CurrentToken.Kind == SyntaxKind.ConstKeyword) 3290if (this.CurrentToken.Kind == SyntaxKind.ConstKeyword) 5493if (mods.Any(SyntaxKind.ConstKeyword)) 5864modifiers.Add(this.EatToken(SyntaxKind.ConstKeyword)); 9254case SyntaxKind.ConstKeyword: 10802if (mods.Any((int)SyntaxKind.ConstKeyword)) 10913case SyntaxKind.ConstKeyword: 11192case SyntaxKind.ConstKeyword:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
907AddKeyword(SyntaxKind.ConstKeyword);
Symbols\Source\ModifierUtils.cs (2)
335return SyntaxFacts.GetText(SyntaxKind.ConstKeyword); 405case SyntaxKind.ConstKeyword:
Symbols\Source\SourceMemberContainerSymbol.cs (1)
3226!ContainsModifier(fieldDecl.Modifiers, SyntaxKind.ConstKeyword);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
81if (modifier.Kind() == SyntaxKind.ConstKeyword) 87Debug.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)
975return SyntaxKind.ConstKeyword; 1676case SyntaxKind.ConstKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
30public static readonly SyntaxToken ConstKeyword = Token(SyntaxKind.ConstKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
131SyntaxKind.ConstKeyword => Modifiers.Const,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
381=> BothHaveModifier(x, y, SyntaxKind.ConstKeyword, out comparisonResult);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
28.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 33if (fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword)) 43.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
737syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) || 1793if (token.IsKind(SyntaxKind.ConstKeyword) && 2092return fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword); 2099return localDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword);
Microsoft.CodeAnalysis.CSharp.Features (28)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
664case SyntaxKind.ConstKeyword:
Completion\KeywordRecommenders\BoolKeywordRecommender.cs (1)
37syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\ByteKeywordRecommender.cs (1)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\CharKeywordRecommender.cs (1)
37syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\ConstKeywordRecommender.cs (1)
12internal sealed class ConstKeywordRecommender() : AbstractSyntacticSingleKeywordRecommender(SyntaxKind.ConstKeyword)
Completion\KeywordRecommenders\DecimalKeywordRecommender.cs (1)
37syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\DoubleKeywordRecommender.cs (1)
37syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
55syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\FloatKeywordRecommender.cs (1)
37syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\IntKeywordRecommender.cs (1)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\LongKeywordRecommender.cs (1)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\ObjectKeywordRecommender.cs (1)
37syntaxTree.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)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\ShortKeywordRecommender.cs (1)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\StringKeywordRecommender.cs (1)
39syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\UIntKeywordRecommender.cs (1)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\ULongKeywordRecommender.cs (1)
38syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
Completion\KeywordRecommenders\UShortKeywordRecommender.cs (1)
45syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
EditAndContinue\BreakpointSpans.cs (3)
794if (modifiersOpt.Any(SyntaxKind.ConstKeyword)) 854if (variableDeclarator.Initializer == null || modifiers.Any(SyntaxKind.ConstKeyword)) 876if (variableDeclarator.Initializer == null || modifiers.Any(SyntaxKind.ConstKeyword))
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
925!fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword); 2043return declaration.Modifiers.Any(SyntaxKind.ConstKeyword) ? FeaturesResources.const_field : FeaturesResources.field;
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)
168=> member is FieldDeclarationSyntax field && field.Modifiers.Any(SyntaxKind.ConstKeyword);
SolutionExplorer\CSharpSolutionExplorerSymbolTreeItemProvider.cs (1)
227var isConst = fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpUseLiteralsWhereAppropriate.Fixer.cs (1)
45return SyntaxFactory.Token(SyntaxKind.ConstKeyword);
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
Classification\ClassificationHelpers.cs (2)
247FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword) ? ClassificationTypeNames.ConstantName : ClassificationTypeNames.FieldName, 333if (parentNode.GetModifiers().Any(SyntaxKind.ConstKeyword))
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
382: fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
30public static readonly SyntaxToken ConstKeyword = Token(SyntaxKind.ConstKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
131SyntaxKind.ConstKeyword => Modifiers.Const,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
381=> BothHaveModifier(x, y, SyntaxKind.ConstKeyword, out comparisonResult);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
28.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 33if (fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword)) 43.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
737syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) || 1793if (token.IsKind(SyntaxKind.ConstKeyword) && 2092return fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword); 2099return localDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword);
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\Legacy\NativeCSharpTokenizer.cs (1)
53CSharpSyntaxKind.ConstKeyword,
Microsoft.ML.InternalCodeAnalyzer (1)
NameAnalyzer.cs (1)
151if (mod.IsKind(SyntaxKind.ConstKeyword))
Roslyn.Diagnostics.CSharp.Analyzers (10)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
30public static readonly SyntaxToken ConstKeyword = Token(SyntaxKind.ConstKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
131SyntaxKind.ConstKeyword => Modifiers.Const,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
381=> BothHaveModifier(x, y, SyntaxKind.ConstKeyword, out comparisonResult);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
28.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 33if (fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword)) 43.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
737syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) || 1793if (token.IsKind(SyntaxKind.ConstKeyword) && 2092return fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword); 2099return localDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword);