mirror of
https://github.com/godotengine/godot.git
synced 2025-10-29 20:51:14 +00:00
C#: Fix ScriptPathAttribute generator with none or nested namespaces
The following two bugs were fixed:
- For classes without namespace we were still generating `namespace {`
without a namespace identifier, causing a syntax error.
- For classes with nested namespaces we were generating only the innermost
part of the namespace was being generated, e.g.: for `Foo.Bar` we were
generating `namespace Bar {` instead of `namespace Foo.Bar {`.
This wasn't causing any build error, but because of the wrong namespace
Godot wasn't able to find the class associated with the script.
This commit is contained in:
parent
bf309b8a13
commit
ee8e5146a4
4 changed files with 54 additions and 24 deletions
|
|
@ -82,5 +82,8 @@ namespace Godot.SourceGenerators
|
|||
|
||||
public static string FullQualifiedName(this INamedTypeSymbol symbol)
|
||||
=> symbol.ToDisplayString(NullableFlowState.NotNull, FullyQualifiedFormatOmitGlobal);
|
||||
|
||||
public static string FullQualifiedName(this INamespaceSymbol namespaceSymbol)
|
||||
=> namespaceSymbol.ToDisplayString(FullyQualifiedFormatOmitGlobal);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue