117 references to ReadOnlyKeyword
Microsoft.CodeAnalysis.CSharp (35)
_generated\0\Syntax.xml.Main.Generated.cs (2)
2528
case SyntaxKind.
ReadOnlyKeyword
:
6090
case SyntaxKind.
ReadOnlyKeyword
:
_generated\1\Syntax.xml.Internal.Generated.cs (4)
28958
case SyntaxKind.
ReadOnlyKeyword
:
33299
case SyntaxKind.
ReadOnlyKeyword
:
34385
case SyntaxKind.
ReadOnlyKeyword
:
38726
case SyntaxKind.
ReadOnlyKeyword
:
Binder\Binder_Crefs.cs (1)
1137
if (refKind == RefKind.Ref && parameter.ReadOnlyKeyword.IsKind(SyntaxKind.
ReadOnlyKeyword
))
Declarations\DeclarationTreeBuilder.cs (1)
796
else if (modifier.IsKind(SyntaxKind.
ReadOnlyKeyword
) && kind is DeclarationKind.Struct or DeclarationKind.RecordStruct)
Parser\DocumentationCommentParser.cs (1)
1327
if (CurrentToken.Kind == SyntaxKind.
ReadOnlyKeyword
&& refKindOpt is not null)
Parser\LanguageParser.cs (10)
1328
case SyntaxKind.
ReadOnlyKeyword
:
2455
case SyntaxKind.
ReadOnlyKeyword
:
5045
case SyntaxKind.
ReadOnlyKeyword
:
7263
if (this.CurrentToken.Kind == SyntaxKind.
ReadOnlyKeyword
)
7631
this.CurrentToken.Kind == SyntaxKind.
ReadOnlyKeyword
? this.EatToken() : null,
9293
case SyntaxKind.
ReadOnlyKeyword
:
10866
else if (k is SyntaxKind.
ReadOnlyKeyword
or SyntaxKind.VolatileKeyword)
10915
case SyntaxKind.
ReadOnlyKeyword
:
11001
case SyntaxKind.
ReadOnlyKeyword
:
13970
case SyntaxKind.
ReadOnlyKeyword
:
SymbolDisplay\SymbolDisplayVisitor.cs (1)
256
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
SymbolDisplay\SymbolDisplayVisitor.Members.cs (4)
913
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
1119
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
1129
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
1153
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
754
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
788
AddKeyword(SyntaxKind.
ReadOnlyKeyword
);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
45
if (modifiers.Count > i + 1 && modifiers[i + 1].Kind() == SyntaxKind.
ReadOnlyKeyword
)
Symbols\Source\ModifierUtils.cs (3)
29
var readonlyToken = modifiers.FirstOrDefault(SyntaxKind.
ReadOnlyKeyword
);
333
return SyntaxFacts.GetText(SyntaxKind.
ReadOnlyKeyword
);
393
case SyntaxKind.
ReadOnlyKeyword
:
Symbols\Source\ParameterHelpers.cs (2)
794
case SyntaxKind.
ReadOnlyKeyword
:
1179
case SyntaxKind.
ReadOnlyKeyword
:
Syntax\SyntaxKindFacts.cs (2)
971
return SyntaxKind.
ReadOnlyKeyword
;
1672
case SyntaxKind.
ReadOnlyKeyword
:
Syntax\SyntaxNodeExtensions.cs (1)
253
refKind = refType.ReadOnlyKeyword.Kind() == SyntaxKind.
ReadOnlyKeyword
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
186
property.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
84
public static readonly SyntaxToken ReadOnlyKeyword = Token(SyntaxKind.
ReadOnlyKeyword
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
174
SyntaxKind.
ReadOnlyKeyword
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
96
case SyntaxKind.
ReadOnlyKeyword
:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
132
SyntaxKind.
ReadOnlyKeyword
=> Modifiers.ReadOnly,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
77
if (otherAccessor.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
129
.WithModifiers(TokenList(updatedProperty.Modifiers.Where(token => !token.IsKind(SyntaxKind.
ReadOnlyKeyword
))));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
384
=> BothHaveModifier(x, y, SyntaxKind.
ReadOnlyKeyword
, out comparisonResult);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
39
.Where(f => f.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
43
.Where(f => !f.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
48
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
573
SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
739
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ReadOnlyKeyword
, cancellationToken) ||
1115
if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.
ReadOnlyKeyword
or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
1803
if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
26
SyntaxKind.
ReadOnlyKeyword
,
41
SyntaxKind.
ReadOnlyKeyword
,
58
SyntaxKind.
ReadOnlyKeyword
,
Microsoft.CodeAnalysis.CSharp.Features (28)
Completion\CompletionProviders\CompletionUtilities.cs (1)
341
if (prevToken.Kind() is SyntaxKind.RefKeyword or SyntaxKind.
ReadOnlyKeyword
&& prevToken.Parent.IsKind(SyntaxKind.RefType))
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
652
case SyntaxKind.
ReadOnlyKeyword
:
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (2)
45
!syntaxTree.IsAfterKeyword(position, SyntaxKind.
ReadOnlyKeyword
, cancellationToken))
54
if (token.Kind() is SyntaxKind.
ReadOnlyKeyword
)
Completion\KeywordRecommenders\ClosedKeywordRecommender.cs (1)
17
.Where(s => s is not (SyntaxKind.ClosedKeyword or SyntaxKind.AbstractKeyword or SyntaxKind.SealedKeyword or SyntaxKind.StaticKeyword or SyntaxKind.
ReadOnlyKeyword
or SyntaxKind.RefKeyword))
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
72
=> context.TargetToken.Kind() is SyntaxKind.RefKeyword or SyntaxKind.
ReadOnlyKeyword
&&
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
33
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
25
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (3)
14
internal sealed class ReadOnlyKeywordRecommender() : AbstractSyntacticSingleKeywordRecommender(SyntaxKind.
ReadOnlyKeyword
)
50
return context.IsTypeDeclarationContext(validModifiers: SyntaxKindSet.AllTypeModifiers.Except([SyntaxKind.
ReadOnlyKeyword
]).ToSet(),
59
context.TargetToken.IsAnyAccessorDeclarationContext(context.Position, SyntaxKind.
ReadOnlyKeyword
);
Completion\KeywordRecommenders\RecordKeywordRecommender.cs (1)
26
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
52
SyntaxKind.
ReadOnlyKeyword
,
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\StaticKeywordRecommender.cs (3)
35
SyntaxKind.
ReadOnlyKeyword
,
50
SyntaxKind.
ReadOnlyKeyword
,
64
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
23
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
45
or SyntaxKind.
ReadOnlyKeyword
)
Completion\KeywordRecommenders\UnionKeywordRecommender.cs (1)
21
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (2)
38
SyntaxKind.
ReadOnlyKeyword
,
52
SyntaxKind.
ReadOnlyKeyword
,
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
34
SyntaxKind.
ReadOnlyKeyword
,
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
253
result.Add(Keyword(SyntaxKind.
ReadOnlyKeyword
));
Snippets\CSharpStructSnippetProvider.cs (1)
29
SyntaxKind.
ReadOnlyKeyword
,
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
186
property.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
77
if (otherAccessor.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
129
.WithModifiers(TokenList(updatedProperty.Modifiers.Where(token => !token.IsKind(SyntaxKind.
ReadOnlyKeyword
))));
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpUseLiteralsWhereAppropriate.Fixer.cs (1)
40
return syntaxToken.IsKind(SyntaxKind.
ReadOnlyKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
84
public static readonly SyntaxToken ReadOnlyKeyword = Token(SyntaxKind.
ReadOnlyKeyword
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
174
SyntaxKind.
ReadOnlyKeyword
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
96
case SyntaxKind.
ReadOnlyKeyword
:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
132
SyntaxKind.
ReadOnlyKeyword
=> Modifiers.ReadOnly,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
384
=> BothHaveModifier(x, y, SyntaxKind.
ReadOnlyKeyword
, out comparisonResult);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
39
.Where(f => f.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
43
.Where(f => !f.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
48
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
573
SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
739
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ReadOnlyKeyword
, cancellationToken) ||
1115
if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.
ReadOnlyKeyword
or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
1803
if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
26
SyntaxKind.
ReadOnlyKeyword
,
41
SyntaxKind.
ReadOnlyKeyword
,
58
SyntaxKind.
ReadOnlyKeyword
,
Microsoft.CodeAnalysis.Razor.Compiler (2)
Language\Intermediate\CommonModifiers.cs (1)
31
GetText(CSharpSyntaxKind.
ReadOnlyKeyword
)];
Language\Legacy\NativeCSharpTokenizer.cs (1)
38
CSharpSyntaxKind.
ReadOnlyKeyword
,
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
EmitterTests.cs (1)
39
mod => mod.IsKind(SyntaxKind.
ReadOnlyKeyword
));
Microsoft.Interop.SourceGeneration (1)
Marshalling\MarshallerHelpers.cs (1)
411
tokens = tokens.Add(Token(SyntaxKind.
ReadOnlyKeyword
));
Roslyn.Diagnostics.CSharp.Analyzers (16)
CSharpExposeMemberForTesting.cs (1)
44
RefKind.RefReadOnly => SyntaxFactory.Token(SyntaxKind.
ReadOnlyKeyword
),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
84
public static readonly SyntaxToken ReadOnlyKeyword = Token(SyntaxKind.
ReadOnlyKeyword
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
174
SyntaxKind.
ReadOnlyKeyword
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
96
case SyntaxKind.
ReadOnlyKeyword
:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
132
SyntaxKind.
ReadOnlyKeyword
=> Modifiers.ReadOnly,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
384
=> BothHaveModifier(x, y, SyntaxKind.
ReadOnlyKeyword
, out comparisonResult);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (3)
39
.Where(f => f.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
))
43
.Where(f => !f.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
) && !f.Modifiers.Any(SyntaxKind.ConstKeyword))
48
return fieldDeclaration.Modifiers.Any(SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
573
SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
739
syntaxTree.IsAfterKeyword(position, SyntaxKind.
ReadOnlyKeyword
, cancellationToken) ||
1115
if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.
ReadOnlyKeyword
or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword)
1803
if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.
ReadOnlyKeyword
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
26
SyntaxKind.
ReadOnlyKeyword
,
41
SyntaxKind.
ReadOnlyKeyword
,
58
SyntaxKind.
ReadOnlyKeyword
,