135 references to RefKeyword
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
169previous.IsKind(SyntaxKind.RefKeyword) ||
Microsoft.CodeAnalysis.CSharp (68)
_generated\0\Syntax.xml.Main.Generated.cs (8)
2525if (refKeyword.Kind() != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 2538=> SyntaxFactory.RefType(SyntaxFactory.Token(SyntaxKind.RefKeyword), default, type); 3182case SyntaxKind.RefKeyword: 3253if (refKeyword.Kind() != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 3260=> SyntaxFactory.RefExpression(SyntaxFactory.Token(SyntaxKind.RefKeyword), expression); 5398if (refKeyword.Kind() != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 5405=> SyntaxFactory.RefStructConstraint(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.StructKeyword)); 6082case SyntaxKind.RefKeyword:
_generated\1\Syntax.xml.Internal.Generated.cs (10)
28953if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 29742case SyntaxKind.RefKeyword: 29865if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 32534if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 33288case SyntaxKind.RefKeyword: 34380if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 35169case SyntaxKind.RefKeyword: 35292if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 37961if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 38715case SyntaxKind.RefKeyword:
Declarations\DeclarationTreeBuilder.cs (1)
800else if (modifier.IsKind(SyntaxKind.RefKeyword) && kind is DeclarationKind.Struct or DeclarationKind.RecordStruct)
Parser\DocumentationCommentParser.cs (3)
1298case SyntaxKind.RefKeyword: 1319case SyntaxKind.RefKeyword: 1329if (refKindOpt.Kind != SyntaxKind.RefKeyword)
Parser\LanguageParser.cs (24)
1338case SyntaxKind.RefKeyword: 2340return (this.CurrentToken.ContextualKind == SyntaxKind.AllowsKeyword && PeekToken(1).Kind == SyntaxKind.RefKeyword) || this.IsTrueIdentifier(); 2393PeekToken(1).Kind == SyntaxKind.RefKeyword) 2403this.EatToken(SyntaxKind.RefKeyword), 2406if (this.CurrentToken.Kind == SyntaxKind.CommaToken && PeekToken(1).Kind == SyntaxKind.RefKeyword) 2475case SyntaxKind.RefKeyword: 4442var refKeyword = this.CurrentToken.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression) 5041case SyntaxKind.RefKeyword: 5647var refKeyword = isLocalOrField && !isConst && this.CurrentToken.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression) 7258if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 7627if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 8554if (tk == SyntaxKind.RefKeyword || 8707if (tk == SyntaxKind.RefKeyword) 9294case SyntaxKind.RefKeyword: 9679if (this.PeekToken(1).Kind == SyntaxKind.RefKeyword) 9690else if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 11166case SyntaxKind.RefKeyword: 11397return SyntaxFacts.IsPrefixUnaryExpression(kind) && kind is not SyntaxKind.RefKeyword and not SyntaxKind.OutKeyword; 11880if (operatorExpressionKind == SyntaxKind.SimpleAssignmentExpression && CurrentToken.Kind == SyntaxKind.RefKeyword && 12105case SyntaxKind.RefKeyword: 12609case SyntaxKind.RefKeyword: 12629!(this.CurrentToken.Kind == SyntaxKind.RefKeyword && 13845case SyntaxKind.RefKeyword: 13971case SyntaxKind.RefKeyword:
SymbolDisplay\SymbolDisplayVisitor.cs (1)
251AddKeyword(SyntaxKind.RefKeyword);
SymbolDisplay\SymbolDisplayVisitor.Members.cs (4)
1103AddKeyword(SyntaxKind.RefKeyword); 1117AddKeyword(SyntaxKind.RefKeyword); 1143AddKeyword(SyntaxKind.RefKeyword); 1151AddKeyword(SyntaxKind.RefKeyword);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
794AddKeyword(SyntaxKind.RefKeyword); 990AddKeyword(SyntaxKind.RefKeyword);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
44case SyntaxKind.RefKeyword when refKind == RefKind.None: 58case SyntaxKind.RefKeyword:
Symbols\RefKindExtensions.cs (1)
25case SyntaxKind.RefKeyword:
Symbols\Source\ModifierUtils.cs (2)
355return SyntaxFacts.GetText(SyntaxKind.RefKeyword); 411case SyntaxKind.RefKeyword:
Symbols\Source\ParameterHelpers.cs (8)
637case SyntaxKind.RefKeyword: 649addERR_ParamsCantBeWithModifier(diagnostics, modifier, SyntaxKind.RefKeyword); 684addERR_BadParameterModifiers(diagnostics, modifier, SyntaxKind.RefKeyword); 711addERR_BadParameterModifiers(diagnostics, modifier, SyntaxKind.RefKeyword); 755addERR_BadParameterModifiers(diagnostics, modifier, SyntaxKind.RefKeyword); 787if (nextModifier.Kind() is not (SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ScopedKeyword)) 799else if (previousModifier?.Kind() != SyntaxKind.RefKeyword) 1153case SyntaxKind.RefKeyword:
Syntax\SyntaxKindFacts.cs (2)
995return SyntaxKind.RefKeyword; 1696case SyntaxKind.RefKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
167if (target.Syntax.DescendantNodesAndSelf().OfType<ArgumentSyntax>().Any(a => a.RefKindKeyword.Kind() is SyntaxKind.RefKeyword))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
86public static readonly SyntaxToken RefKeyword = Token(SyntaxKind.RefKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (2)
27SyntaxKind.RefKeyword => RefKind.Ref, 87if (argument.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
213ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
100case SyntaxKind.RefKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
136SyntaxKind.RefKeyword => Modifiers.Ref,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
738syntaxTree.IsAfterKeyword(position, SyntaxKind.RefKeyword, cancellationToken) || 1115if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword) 1295if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword) 1803if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword) 2453if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
27SyntaxKind.RefKeyword
Microsoft.CodeAnalysis.CSharp.Features (17)
Completion\CompletionProviders\CompletionUtilities.cs (1)
341if (prevToken.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword && prevToken.Parent.IsKind(SyntaxKind.RefType))
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
151return token is (kind: SyntaxKind.CommaToken or SyntaxKind.RefKeyword or SyntaxKind.OutKeyword);
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (2)
44if (!syntaxTree.IsAfterKeyword(position, SyntaxKind.RefKeyword, cancellationToken) && 58if (token.Kind() != SyntaxKind.RefKeyword)
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\ReadOnlyKeywordRecommender.cs (1)
42=> context.TargetToken.IsKind(SyntaxKind.RefKeyword) &&
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
16internal sealed class RefKeywordRecommender() : AbstractSyntacticSingleKeywordRecommender(SyntaxKind.RefKeyword)
Completion\KeywordRecommenders\StructKeywordRecommender.cs (2)
22SyntaxKind.RefKeyword, 57if (token.Kind() == SyntaxKind.RefKeyword &&
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
43or SyntaxKind.RefKeyword
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
402? SyntaxKind.RefKeyword
SignatureHelp\AbstractGenericNameSignatureHelpProvider.cs (1)
273parts.Add(Keyword(SyntaxKind.RefKeyword));
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
246result.Add(Keyword(SyntaxKind.RefKeyword)); 251result.Add(Keyword(SyntaxKind.RefKeyword));
Snippets\CSharpStructSnippetProvider.cs (1)
28SyntaxKind.RefKeyword,
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
167if (target.Syntax.DescendantNodesAndSelf().OfType<ArgumentSyntax>().Any(a => a.RefKindKeyword.Kind() is SyntaxKind.RefKeyword))
Microsoft.CodeAnalysis.CSharp.Workspaces (12)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
86public static readonly SyntaxToken RefKeyword = Token(SyntaxKind.RefKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (2)
27SyntaxKind.RefKeyword => RefKind.Ref, 87if (argument.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
213ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
100case SyntaxKind.RefKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
136SyntaxKind.RefKeyword => Modifiers.Ref,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
738syntaxTree.IsAfterKeyword(position, SyntaxKind.RefKeyword, cancellationToken) || 1115if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword) 1295if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword) 1803if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword) 2453if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
27SyntaxKind.RefKeyword
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\Legacy\NativeCSharpTokenizer.cs (1)
48CSharpSyntaxKind.RefKeyword,
Microsoft.Gen.ContextualOptions (1)
Parser.cs (1)
45.Where(modifier => modifier.IsKind(SyntaxKind.RefKeyword))
Microsoft.Interop.JavaScript.JSImportGenerator (4)
Marshaling\FuncJSGenerator.cs (2)
97.WithModifiers(TokenList(Token(SyntaxKind.RefKeyword))) 112.WithModifiers(TokenList(Token(SyntaxKind.RefKeyword)))
Marshaling\TaskJSGenerator.cs (2)
78.WithModifiers(TokenList(Token(SyntaxKind.RefKeyword))) 101.WithModifiers(TokenList(Token(SyntaxKind.RefKeyword)))
Microsoft.Interop.SourceGeneration (5)
Marshalling\MarshallerHelpers.cs (3)
403tokens = tokens.Add(Token(SyntaxKind.RefKeyword)); 410tokens = tokens.Add(Token(SyntaxKind.RefKeyword)); 432RefKind.Ref => Token(SyntaxKind.RefKeyword),
SyntaxExtensions.cs (1)
107int idxRef = modifiers.IndexOf(SyntaxKind.RefKeyword);
Utils\SyntaxFactoryExtensions.cs (1)
72=> Argument(null, Token(SyntaxKind.RefKeyword), expression);
Roslyn.Diagnostics.CSharp.Analyzers (13)
CSharpExposeMemberForTesting.cs (1)
40var refKeyword = SyntaxFactory.Token(SyntaxKind.RefKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
86public static readonly SyntaxToken RefKeyword = Token(SyntaxKind.RefKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (2)
27SyntaxKind.RefKeyword => RefKind.Ref, 87if (argument.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
213ArgumentSyntax { RefOrOutKeyword.RawKind: (int)SyntaxKind.RefKeyword })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
100case SyntaxKind.RefKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
136SyntaxKind.RefKeyword => Modifiers.Ref,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
738syntaxTree.IsAfterKeyword(position, SyntaxKind.RefKeyword, cancellationToken) || 1115if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword or SyntaxKind.OutKeyword or SyntaxKind.ThisKeyword or SyntaxKind.ParamsKeyword or SyntaxKind.ScopedKeyword) 1295if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword) 1803if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.ReadOnlyKeyword) 2453if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
27SyntaxKind.RefKeyword