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)
2537if (refKeyword.Kind() != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 2550=> SyntaxFactory.RefType(SyntaxFactory.Token(SyntaxKind.RefKeyword), default, type); 3210case SyntaxKind.RefKeyword: 3281if (refKeyword.Kind() != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 3288=> SyntaxFactory.RefExpression(SyntaxFactory.Token(SyntaxKind.RefKeyword), expression); 5436if (refKeyword.Kind() != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 5443=> SyntaxFactory.RefStructConstraint(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.StructKeyword)); 6120case SyntaxKind.RefKeyword:
_generated\1\Syntax.xml.Internal.Generated.cs (10)
29093if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 29897case SyntaxKind.RefKeyword: 30020if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 32669if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 33423case SyntaxKind.RefKeyword: 34515if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 35319case SyntaxKind.RefKeyword: 35442if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 38091if (refKeyword.Kind != SyntaxKind.RefKeyword) throw new ArgumentException(nameof(refKeyword)); 38845case 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: 4447var refKeyword = this.CurrentToken.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression) 5046case SyntaxKind.RefKeyword: 5652var refKeyword = isLocalOrField && !isConst && this.CurrentToken.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression) 7263if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 7632if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 8575if (tk == SyntaxKind.RefKeyword || 8728if (tk == SyntaxKind.RefKeyword) 9315case SyntaxKind.RefKeyword: 9702if (this.PeekToken(1).Kind == SyntaxKind.RefKeyword) 9713else if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 11190case SyntaxKind.RefKeyword: 11422return SyntaxFacts.IsPrefixUnaryExpression(kind) && kind is not SyntaxKind.RefKeyword and not SyntaxKind.OutKeyword; 11905if (operatorExpressionKind == SyntaxKind.SimpleAssignmentExpression && CurrentToken.Kind == SyntaxKind.RefKeyword && 12132case SyntaxKind.RefKeyword: 12636case SyntaxKind.RefKeyword: 12656!(this.CurrentToken.Kind == SyntaxKind.RefKeyword && 13881case SyntaxKind.RefKeyword: 14007case 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)
997return SyntaxKind.RefKeyword; 1698case 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) 2446if (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)
154return 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) 2446if (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) 2446if (token.Kind() is SyntaxKind.RefKeyword or SyntaxKind.InKeyword or SyntaxKind.OutKeyword)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (1)
27SyntaxKind.RefKeyword