Merge pull request #79007 from 398utubzyt/dotnet/globalclass-analyzer
C#: Add a Roslyn analyzer for global classes
This commit is contained in:
commit
bb6879e7cc
3 changed files with 104 additions and 2 deletions
|
|
@ -81,7 +81,7 @@ namespace Godot.SourceGenerators
|
|||
return godotClassName ?? nativeType.Name;
|
||||
}
|
||||
|
||||
private static bool IsGodotScriptClass(
|
||||
private static bool TryGetGodotScriptClass(
|
||||
this ClassDeclarationSyntax cds, Compilation compilation,
|
||||
out INamedTypeSymbol? symbol
|
||||
)
|
||||
|
|
@ -108,7 +108,7 @@ namespace Godot.SourceGenerators
|
|||
{
|
||||
foreach (var cds in source)
|
||||
{
|
||||
if (cds.IsGodotScriptClass(compilation, out var symbol))
|
||||
if (cds.TryGetGodotScriptClass(compilation, out var symbol))
|
||||
yield return (cds, symbol!);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue