120 references to RecordDeclarationSyntax
Microsoft.CodeAnalysis.CSharp (16)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
819public override Binder VisitRecordDeclaration(RecordDeclarationSyntax node)
Binder\LocalBinderFactory.cs (1)
169public override void VisitRecordDeclaration(RecordDeclarationSyntax node)
Compilation\SyntaxTreeSemanticModel.cs (1)
2507case ParameterSyntax param when declaredSymbol.Kind == SymbolKind.Property && param.Parent?.Parent is RecordDeclarationSyntax recordDeclaration && recordDeclaration.ParameterList == param.Parent:
Declarations\DeclarationTreeBuilder.cs (3)
671public override SingleNamespaceOrTypeDeclaration VisitRecordDeclaration(RecordDeclarationSyntax node) 700var hasPrimaryCtor = node.ParameterList != null && node is RecordDeclarationSyntax or ClassDeclarationSyntax or StructDeclarationSyntax; 724if (node is RecordDeclarationSyntax record)
Lowering\Instrumentation\DebugInfoInjector.cs (2)
215original.Syntax is RecordDeclarationSyntax { ParameterList.Parameters.Count: > 0 }) 414Debug.Assert(parameterSyntax is { Parent.Parent: RecordDeclarationSyntax });
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
61case RecordDeclarationSyntax recordDecl:
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
69var recordDeclaration = (RecordDeclarationSyntax)F.Syntax;
Syntax\RecordDeclarationSyntax.cs (5)
13public RecordDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken keyword, SyntaxToken identifier, 27public static RecordDeclarationSyntax RecordDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken keyword, SyntaxToken identifier, 35public static RecordDeclarationSyntax RecordDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken keyword, SyntaxToken identifier, 46public static RecordDeclarationSyntax RecordDeclaration(SyntaxToken keyword, string identifier) 51public static RecordDeclarationSyntax RecordDeclaration(SyntaxToken keyword, SyntaxToken identifier)
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs (1)
35Parent: RecordDeclarationSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
53c => c.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is RecordDeclarationSyntax or ClassDeclarationSyntax or StructDeclarationSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1096case RecordDeclarationSyntax record:
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
375private static RecordDeclarationSyntax CreateRecordDeclaration(
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (5)
30Diagnostic diagnostic, CancellationToken cancellationToken, [NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) 32recordDeclaration = diagnostic.Location.FindNode(cancellationToken) as RecordDeclarationSyntax; 37RecordDeclarationSyntax recordDeclaration, 107var currentRecordDeclaration = (RecordDeclarationSyntax)current;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (3)
85declaration = GenerateRecordMembers(service, info, (RecordDeclarationSyntax)declaration, members, cancellationToken); 101private static RecordDeclarationSyntax GenerateRecordMembers( 104RecordDeclarationSyntax recordDeclaration,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
371IsRecordParameterAttributeContext(out var record) && 387public bool IsRecordParameterAttributeContext([NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) 393token.Parent.Parent is ParameterSyntax { Parent: ParameterListSyntax { Parent: RecordDeclarationSyntax record } })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
271public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (20)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
4086var recordDeclaration = (RecordDeclarationSyntax)context.Node;
Semantics\RecordTests.cs (18)
21496var recordDeclarations = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Skip(1).ToArray(); 21557var recordDeclarations = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Skip(1).ToArray(); 21625var recordDeclarations = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Skip(1).ToArray(); 21714var recordDeclarations = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Skip(1).ToArray(); 22917var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().First(); 23371var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().ElementAt(1); 24654var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Single(); 26322var record = (RecordDeclarationSyntax)context.Node; 27292case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: 27303case RecordDeclarationSyntax { Identifier: { ValueText: "B" } }: 27437case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: 27448case RecordDeclarationSyntax { Identifier: { ValueText: "B" } }: 27505case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: 27516case RecordDeclarationSyntax { Identifier: { ValueText: "B" } }:
Microsoft.CodeAnalysis.CSharp.Features (27)
CodeLens\CSharpCodeLensMemberFinder.cs (1)
82public override void VisitRecordDeclaration(RecordDeclarationSyntax node)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
51if (typeDeclaration is RecordDeclarationSyntax)
EditAndContinue\BreakpointSpans.cs (3)
208if (position >= typeDeclaration.Identifier.SpanStart && node is RecordDeclarationSyntax recordDeclaration) 511internal static TextSpan CreateSpanForCopyConstructor(RecordDeclarationSyntax recordDeclaration) 516internal static IEnumerable<SyntaxToken> GetActiveTokensForCopyConstructor(RecordDeclarationSyntax recordDeclaration)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (7)
73/// <see cref="RecordDeclarationSyntax"/> for record copy-constructors. 99var recordDeclaration = (RecordDeclarationSyntax)current; 134if (current is { Parent.Parent: RecordDeclarationSyntax }) 676span = BreakpointSpans.CreateSpanForCopyConstructor((RecordDeclarationSyntax)node); 1124if (oldNode is ParameterSyntax { Parent.Parent: RecordDeclarationSyntax } || 1125newNode is ParameterSyntax { Parent.Parent: RecordDeclarationSyntax })
EditAndContinue\DeclarationBody\CopyConstructorDeclarationBody.cs (1)
16internal sealed class CopyConstructorDeclarationBody(RecordDeclarationSyntax recordDeclaration) : InstanceConstructorDeclarationBody
EditAndContinue\SyntaxUtilities.cs (2)
65RecordDeclarationSyntax recordDeclarationSyntax when symbol is not INamedTypeSymbol 69ParameterSyntax { Parent.Parent: RecordDeclarationSyntax } parameterSyntax when symbol is not IParameterSymbol
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
386public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node)
Organizing\Organizers\RecordDeclarationOrganizer.cs (3)
15internal class RecordDeclarationOrganizer : AbstractSyntaxNodeOrganizer<RecordDeclarationSyntax> 23protected override RecordDeclarationSyntax Organize( 24RecordDeclarationSyntax syntax,
src\Analyzers\CSharp\Analyzers\NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs (1)
35Parent: RecordDeclarationSyntax
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
375private static RecordDeclarationSyntax CreateRecordDeclaration(
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (5)
30Diagnostic diagnostic, CancellationToken cancellationToken, [NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) 32recordDeclaration = diagnostic.Location.FindNode(cancellationToken) as RecordDeclarationSyntax; 37RecordDeclarationSyntax recordDeclaration, 107var currentRecordDeclaration = (RecordDeclarationSyntax)current;
Structure\CSharpBlockStructureProvider.cs (1)
46builder.Add<RecordDeclarationSyntax, TypeDeclarationStructureProvider>();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\RecordStructTests.cs (7)
2605var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().Single(); 6042var record = (RecordDeclarationSyntax)context.Node; 6574case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: 6666case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }: 6724case RecordDeclarationSyntax { Identifier: { ValueText: "A" } }:
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Generated\Syntax.Test.xml.Generated.cs (5)
10727private static RecordDeclarationSyntax GenerateRecordDeclaration() 13042var node = GenerateRecordDeclaration(); 13057var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithKeyword(node.Keyword).WithClassOrStructKeyword(node.ClassOrStructKeyword).WithIdentifier(node.Identifier).WithTypeParameterList(node.TypeParameterList).WithParameterList(node.ParameterList).WithBaseList(node.BaseList).WithConstraintClauses(node.ConstraintClauses).WithOpenBraceToken(node.OpenBraceToken).WithMembers(node.Members).WithCloseBraceToken(node.CloseBraceToken).WithSemicolonToken(node.SemicolonToken); 18415var oldNode = GenerateRecordDeclaration(); 18431var oldNode = GenerateRecordDeclaration();
Syntax\SyntaxFactoryTests.cs (2)
603var record = SyntaxFactory.RecordDeclaration( 612var record = SyntaxFactory.RecordDeclaration(
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
420if (memberDeclaration is RecordDeclarationSyntax { ParameterList: { Parameters.Count: > 0 } parameterList } recordDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
53c => c.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is RecordDeclarationSyntax or ClassDeclarationSyntax or StructDeclarationSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1096case RecordDeclarationSyntax record:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (3)
85declaration = GenerateRecordMembers(service, info, (RecordDeclarationSyntax)declaration, members, cancellationToken); 101private static RecordDeclarationSyntax GenerateRecordMembers( 104RecordDeclarationSyntax recordDeclaration,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
371IsRecordParameterAttributeContext(out var record) && 387public bool IsRecordParameterAttributeContext([NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) 393token.Parent.Parent is ParameterSyntax { Parent: ParameterListSyntax { Parent: RecordDeclarationSyntax record } })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
271public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (8)
CodeGeneration\SyntaxGeneratorTests.cs (8)
3966VerifySyntax<RecordDeclarationSyntax>( 4005VerifySyntax<RecordDeclarationSyntax>( 4095VerifySyntax<RecordDeclarationSyntax>( 4113VerifySyntax<RecordDeclarationSyntax>( 4597VerifySyntax<RecordDeclarationSyntax>( 4612VerifySyntax<RecordDeclarationSyntax>( 4635VerifySyntax<RecordDeclarationSyntax>( 4650VerifySyntax<RecordDeclarationSyntax>(
Microsoft.Extensions.Options.SourceGeneration (1)
TypeDeclarationSyntaxReceiver.cs (1)
33else if (syntaxNode is RecordDeclarationSyntax recordSyntax)
Microsoft.Gen.ComplianceReports (3)
Parser.cs (2)
51if (typeSyntax is RecordDeclarationSyntax recordSyntax) 103private Dictionary<string, ClassifiedItem>? GetClassifiedMembers(RecordDeclarationSyntax recordSyntax,
src\Generators\Shared\TypeDeclarationSyntaxReceiver.cs (1)
38else if (syntaxNode is RecordDeclarationSyntax recordSyntax)
Microsoft.Gen.Logging (1)
src\Generators\Shared\TypeDeclarationSyntaxReceiver.cs (1)
38else if (syntaxNode is RecordDeclarationSyntax recordSyntax)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\TypeDeclarationSyntaxReceiver.cs (1)
38else if (syntaxNode is RecordDeclarationSyntax recordSyntax)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
444return GetMemberNodesWorker(container, includeSelf, recursive, logicalFields, onlySupportedNodes).Where(t => t is not RecordDeclarationSyntax);
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Parser.cs (2)
206typeDec is RecordDeclarationSyntax rds ? $"{typeDec.Keyword.ValueText} {rds.ClassOrStructKeyword}" : typeDec.Keyword.ValueText, 233parent is RecordDeclarationSyntax rds2 ? $"{parent.Keyword.ValueText} {rds2.ClassOrStructKeyword}" : parent.Keyword.ValueText,