mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
C#: Add a Roslyn analyzer for global classes
Co-Authored-By: Raul Santos <raulsntos@gmail.com>
This commit is contained in:
parent
cdd2313ba2
commit
8e56c807cc
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