Files
RobustToolbox/Robust.Shared.CompNetworkGenerator/NameReferenceSyntaxReceiver.cs
Kara 85547a9be7 Auto-componentstate source generator (#3684)
* dog what am i doing

* finish gen source part from class symbol

* we are dangerously close to things happening

* generation fixes

* oh? on god?

* stop autogenerating the attribute for no reason + diagnostics

* testing diagnostics

* proper type name handling + clonedata bool

* thank you material storage for making me realize this

* forgot to commit

* p

* fixes for afterautohandlestate

* make it work with access
2023-04-06 12:32:57 -05:00

20 lines
658 B
C#

using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Robust.Shared.CompNetworkGenerator
{
public sealed class NameReferenceSyntaxReceiver : ISyntaxReceiver
{
public List<ClassDeclarationSyntax> CandidateClasses { get; } = new List<ClassDeclarationSyntax>();
public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
{
if (syntaxNode is ClassDeclarationSyntax classDeclarationSyntax &&
classDeclarationSyntax.AttributeLists.Count > 0)
CandidateClasses.Add(classDeclarationSyntax);
}
}
}