212 references to ReadOnlyKeyword
Microsoft.CodeAnalysis.CSharp (31)
Binder\Binder_Crefs.cs (1)
936if (refKind == RefKind.Ref && parameter.ReadOnlyKeyword.IsKind(SyntaxKind.ReadOnlyKeyword))
Declarations\DeclarationTreeBuilder.cs (1)
759else if (modifier.IsKind(SyntaxKind.ReadOnlyKeyword) && kind is DeclarationKind.Struct or DeclarationKind.RecordStruct)
Parser\DocumentationCommentParser.cs (1)
1261if (CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword && refKindOpt is not null)
Parser\LanguageParser.cs (12)
1320case SyntaxKind.ReadOnlyKeyword: 2327case SyntaxKind.ReadOnlyKeyword: 4725case SyntaxKind.ReadOnlyKeyword: 4738if (this.CurrentToken.Kind is SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword) 4755while (this.CurrentToken.Kind is (SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword)) 6864if (this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword) 7232this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 8817case SyntaxKind.ReadOnlyKeyword: 10325else if (k is SyntaxKind.ReadOnlyKeyword or SyntaxKind.VolatileKeyword) 10376case SyntaxKind.ReadOnlyKeyword: 10461case SyntaxKind.ReadOnlyKeyword: 13393case SyntaxKind.ReadOnlyKeyword:
SymbolDisplay\SymbolDisplayVisitor.cs (1)
256AddKeyword(SyntaxKind.ReadOnlyKeyword);
SymbolDisplay\SymbolDisplayVisitor.Members.cs (4)
907AddKeyword(SyntaxKind.ReadOnlyKeyword); 1113AddKeyword(SyntaxKind.ReadOnlyKeyword); 1123AddKeyword(SyntaxKind.ReadOnlyKeyword); 1147AddKeyword(SyntaxKind.ReadOnlyKeyword);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
709AddKeyword(SyntaxKind.ReadOnlyKeyword); 743AddKeyword(SyntaxKind.ReadOnlyKeyword);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
45if (modifiers.Count > i + 1 && modifiers[i + 1].Kind() == SyntaxKind.ReadOnlyKeyword)
Symbols\Source\ModifierUtils.cs (3)
28var readonlyToken = modifiers.FirstOrDefault(SyntaxKind.ReadOnlyKeyword); 300return SyntaxFacts.GetText(SyntaxKind.ReadOnlyKeyword); 356case SyntaxKind.ReadOnlyKeyword:
Symbols\Source\ParameterHelpers.cs (2)
602case SyntaxKind.ReadOnlyKeyword: 965case SyntaxKind.ReadOnlyKeyword:
Syntax\SyntaxKindFacts.cs (2)
941return SyntaxKind.ReadOnlyKeyword; 1589case SyntaxKind.ReadOnlyKeyword:
Syntax\SyntaxNodeExtensions.cs (1)
253refKind = refType.ReadOnlyKeyword.Kind() == SyntaxKind.ReadOnlyKeyword
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
189property.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
73public static readonly SyntaxToken ReadOnlyKeyword = Token(SyntaxKind.ReadOnlyKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
166SyntaxKind.ReadOnlyKeyword,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
94case SyntaxKind.ReadOnlyKeyword:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
137SyntaxKind.ReadOnlyKeyword => DeclarationModifiers.ReadOnly,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (12)
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
79if (otherAccessor.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
384=> BothHaveModifier(x, y, SyntaxKind.ReadOnlyKeyword, out comparisonResult);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
40.Where(f => f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)) 44.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword)) 49return fieldDeclaration.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
574SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
731syntaxTree.IsAfterKeyword(position, SyntaxKind.ReadOnlyKeyword, cancellationToken) || 1107if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword) 1795if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
23SyntaxKind.ReadOnlyKeyword, 38SyntaxKind.ReadOnlyKeyword, 55SyntaxKind.ReadOnlyKeyword,
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
547&& !baseFieldDeclarationNode.Modifiers.Any(SyntaxKind.ReadOnlyKeyword);
Microsoft.CodeAnalysis.CSharp.Features (26)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
563case SyntaxKind.ReadOnlyKeyword:
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
145if (prevToken.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword && prevToken.Parent.IsKind(SyntaxKind.RefType))
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (2)
44!syntaxTree.IsAfterKeyword(position, SyntaxKind.ReadOnlyKeyword, cancellationToken)) 53if (token.Kind() is SyntaxKind.ReadOnlyKeyword)
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
72=> context.TargetToken.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword &&
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
33SyntaxKind.ReadOnlyKeyword,
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
25SyntaxKind.ReadOnlyKeyword,
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (3)
27: base(SyntaxKind.ReadOnlyKeyword) 55return context.IsTypeDeclarationContext(validModifiers: SyntaxKindSet.AllTypeModifiers.Except([SyntaxKind.ReadOnlyKeyword]).ToSet(), 64context.TargetToken.IsAnyAccessorDeclarationContext(context.Position, SyntaxKind.ReadOnlyKeyword);
Completion\KeywordRecommenders\RecordKeywordRecommender.cs (1)
25SyntaxKind.ReadOnlyKeyword,
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
56SyntaxKind.ReadOnlyKeyword,
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\StaticKeywordRecommender.cs (3)
35SyntaxKind.ReadOnlyKeyword, 50SyntaxKind.ReadOnlyKeyword, 64SyntaxKind.ReadOnlyKeyword,
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
23SyntaxKind.ReadOnlyKeyword,
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
69SyntaxKind.ReadOnlyKeyword)
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (2)
37SyntaxKind.ReadOnlyKeyword, 51SyntaxKind.ReadOnlyKeyword,
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
34SyntaxKind.ReadOnlyKeyword,
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
260result.Add(Keyword(SyntaxKind.ReadOnlyKeyword));
Snippets\CSharpStructSnippetProvider.cs (1)
33SyntaxKind.ReadOnlyKeyword,
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
189property.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
79if (otherAccessor.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
128.WithModifiers(TokenList(updatedProperty.Modifiers.Where(token => !token.IsKind(SyntaxKind.ReadOnlyKeyword))));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\CrefTests.cs (2)
6749Assert.Equal(SyntaxKind.ReadOnlyKeyword, parameter.ReadOnlyKeyword.Kind()); 6899Assert.Equal(SyntaxKind.ReadOnlyKeyword, parameter.ReadOnlyKeyword.Kind());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (115)
Parsing\CrefParsingTests.cs (5)
1345N(SyntaxKind.ReadOnlyKeyword); 1373N(SyntaxKind.ReadOnlyKeyword); 1417N(SyntaxKind.ReadOnlyKeyword); 1454N(SyntaxKind.ReadOnlyKeyword); 1616N(SyntaxKind.ReadOnlyKeyword);
Parsing\DeclarationParsingTests.cs (7)
2812Assert.Equal(SyntaxKind.ReadOnlyKeyword, ms.Modifiers[0].Kind()); 2859Assert.Equal(SyntaxKind.ReadOnlyKeyword, ms.Modifiers[0].Kind()); 2863Assert.Equal(SyntaxKind.ReadOnlyKeyword, rt.ReadOnlyKeyword.Kind()); 2909Assert.Equal(SyntaxKind.ReadOnlyKeyword, propertySyntax.Modifiers[0].Kind()); 2957Assert.Equal(SyntaxKind.ReadOnlyKeyword, accessors[0].Modifiers[0].Kind()); 3746TestClassFieldModifier(SyntaxKind.ReadOnlyKeyword); 3801TestClassEventFieldModifier(SyntaxKind.ReadOnlyKeyword);
Parsing\DeclarationScopeParsingTests.cs (56)
776N(SyntaxKind.ReadOnlyKeyword); 816N(SyntaxKind.ReadOnlyKeyword); 1479N(SyntaxKind.ReadOnlyKeyword); 1499N(SyntaxKind.ReadOnlyKeyword); 1575N(SyntaxKind.ReadOnlyKeyword); 1691N(SyntaxKind.ReadOnlyKeyword); 1809N(SyntaxKind.ReadOnlyKeyword); 1987N(SyntaxKind.ReadOnlyKeyword); 2036N(SyntaxKind.ReadOnlyKeyword); 2062N(SyntaxKind.ReadOnlyKeyword); 2267N(SyntaxKind.ReadOnlyKeyword); 2373N(SyntaxKind.ReadOnlyKeyword); 2474N(SyntaxKind.ReadOnlyKeyword); 2592N(SyntaxKind.ReadOnlyKeyword); 2744N(SyntaxKind.ReadOnlyKeyword); 2793N(SyntaxKind.ReadOnlyKeyword); 2819N(SyntaxKind.ReadOnlyKeyword); 2928N(SyntaxKind.ReadOnlyKeyword); 3452N(SyntaxKind.ReadOnlyKeyword); 3798N(SyntaxKind.ReadOnlyKeyword); 3899N(SyntaxKind.ReadOnlyKeyword); 3983N(SyntaxKind.ReadOnlyKeyword); 4328N(SyntaxKind.ReadOnlyKeyword); 4422N(SyntaxKind.ReadOnlyKeyword); 4624N(SyntaxKind.ReadOnlyKeyword); 4992N(SyntaxKind.ReadOnlyKeyword); 5496N(SyntaxKind.ReadOnlyKeyword); 6181N(SyntaxKind.ReadOnlyKeyword); 6270N(SyntaxKind.ReadOnlyKeyword); 6357N(SyntaxKind.ReadOnlyKeyword); 6673N(SyntaxKind.ReadOnlyKeyword); 6768N(SyntaxKind.ReadOnlyKeyword); 6941N(SyntaxKind.ReadOnlyKeyword); 7234N(SyntaxKind.ReadOnlyKeyword); 8540N(SyntaxKind.ReadOnlyKeyword); 8589N(SyntaxKind.ReadOnlyKeyword); 8875N(SyntaxKind.ReadOnlyKeyword); 9078N(SyntaxKind.ReadOnlyKeyword); 9346N(SyntaxKind.ReadOnlyKeyword); 9805N(SyntaxKind.ReadOnlyKeyword); 9881N(SyntaxKind.ReadOnlyKeyword); 9955N(SyntaxKind.ReadOnlyKeyword); 10193N(SyntaxKind.ReadOnlyKeyword); 10267N(SyntaxKind.ReadOnlyKeyword); 10386N(SyntaxKind.ReadOnlyKeyword); 10589N(SyntaxKind.ReadOnlyKeyword); 11228N(SyntaxKind.ReadOnlyKeyword); 11238N(SyntaxKind.ReadOnlyKeyword); 12401N(SyntaxKind.ReadOnlyKeyword); 12469N(SyntaxKind.ReadOnlyKeyword); 12536N(SyntaxKind.ReadOnlyKeyword); 12788N(SyntaxKind.ReadOnlyKeyword); 12849N(SyntaxKind.ReadOnlyKeyword); 12992N(SyntaxKind.ReadOnlyKeyword); 13289N(SyntaxKind.ReadOnlyKeyword); 14908N(SyntaxKind.ReadOnlyKeyword);
Parsing\FunctionPointerTests.cs (3)
844N(SyntaxKind.ReadOnlyKeyword); 2140N(SyntaxKind.ReadOnlyKeyword); 3326N(SyntaxKind.ReadOnlyKeyword);
Parsing\LambdaReturnTypeParsingTests.cs (1)
2518N(SyntaxKind.ReadOnlyKeyword);
Parsing\MemberDeclarationParsingTests.cs (4)
10248N(SyntaxKind.ReadOnlyKeyword); 10283N(SyntaxKind.ReadOnlyKeyword); 10316N(SyntaxKind.ReadOnlyKeyword); 10348N(SyntaxKind.ReadOnlyKeyword);
Parsing\RecordParsing.cs (3)
3677N(SyntaxKind.ReadOnlyKeyword); 3698N(SyntaxKind.ReadOnlyKeyword); 3731N(SyntaxKind.ReadOnlyKeyword);
Parsing\RefFieldParsingTests.cs (4)
75N(SyntaxKind.ReadOnlyKeyword); 514N(SyntaxKind.ReadOnlyKeyword); 607N(SyntaxKind.ReadOnlyKeyword); 672N(SyntaxKind.ReadOnlyKeyword);
Parsing\RefReadonlyTests.cs (22)
525N(SyntaxKind.ReadOnlyKeyword); 568N(SyntaxKind.ReadOnlyKeyword); 569N(SyntaxKind.ReadOnlyKeyword); 611N(SyntaxKind.ReadOnlyKeyword); 612N(SyntaxKind.ReadOnlyKeyword); 654N(SyntaxKind.ReadOnlyKeyword); 656N(SyntaxKind.ReadOnlyKeyword); 698N(SyntaxKind.ReadOnlyKeyword); 699N(SyntaxKind.ReadOnlyKeyword); 743N(SyntaxKind.ReadOnlyKeyword); 745N(SyntaxKind.ReadOnlyKeyword); 789N(SyntaxKind.ReadOnlyKeyword); 833N(SyntaxKind.ReadOnlyKeyword); 876N(SyntaxKind.ReadOnlyKeyword); 921N(SyntaxKind.ReadOnlyKeyword); 983N(SyntaxKind.ReadOnlyKeyword); 1035N(SyntaxKind.ReadOnlyKeyword); 1106N(SyntaxKind.ReadOnlyKeyword); 1167N(SyntaxKind.ReadOnlyKeyword); 1211N(SyntaxKind.ReadOnlyKeyword); 1254N(SyntaxKind.ReadOnlyKeyword); 1300N(SyntaxKind.ReadOnlyKeyword);
Parsing\ScriptParsingTests.cs (2)
966NewModifier_WithOtherModifier("readonly", SyntaxKind.ReadOnlyKeyword); 2519N(SyntaxKind.ReadOnlyKeyword);
Parsing\StatementParsingTests.cs (4)
716Assert.Equal(SyntaxKind.ReadOnlyKeyword, ds.Modifiers[0].Kind()); 2530N(SyntaxKind.ReadOnlyKeyword); 3189N(SyntaxKind.ReadOnlyKeyword); 3298N(SyntaxKind.ReadOnlyKeyword);
Parsing\TopLevelStatementsParsingTests.cs (2)
2068N(SyntaxKind.ReadOnlyKeyword); 3129N(SyntaxKind.ReadOnlyKeyword);
Parsing\UsingDirectiveParsingTests.cs (1)
1046N(SyntaxKind.ReadOnlyKeyword);
Syntax\SyntaxNodeCacheTests.cs (1)
62var child2 = new SyntaxTokenWithTrivia(SyntaxKind.ReadOnlyKeyword, null, null);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
73public static readonly SyntaxToken ReadOnlyKeyword = Token(SyntaxKind.ReadOnlyKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
166SyntaxKind.ReadOnlyKeyword,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
94case SyntaxKind.ReadOnlyKeyword:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
137SyntaxKind.ReadOnlyKeyword => DeclarationModifiers.ReadOnly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
384=> BothHaveModifier(x, y, SyntaxKind.ReadOnlyKeyword, out comparisonResult);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
40.Where(f => f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)) 44.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword)) 49return fieldDeclaration.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
574SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
731syntaxTree.IsAfterKeyword(position, SyntaxKind.ReadOnlyKeyword, cancellationToken) || 1107if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword) 1795if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
23SyntaxKind.ReadOnlyKeyword, 38SyntaxKind.ReadOnlyKeyword, 55SyntaxKind.ReadOnlyKeyword,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
761yield return CS.SyntaxFactory.Token(CS.SyntaxKind.ReadOnlyKeyword);
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
EmitterTests.cs (1)
39mod => mod.IsKind(SyntaxKind.ReadOnlyKeyword));
Microsoft.Interop.SourceGeneration (1)
Marshalling\MarshallerHelpers.cs (1)
438tokens = tokens.Add(Token(SyntaxKind.ReadOnlyKeyword));
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\ModifierFlagsExtensions.cs (2)
30{ ModifierFlags.ReadOnly, SyntaxKind.ReadOnlyKeyword }, 79case SyntaxKind.ReadOnlyKeyword: