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