Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Fix internal source generator on the 7.0.200 SDK #73382

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

RedworkDE
Copy link
Member

Problem: After installing the 7.0.200 SDK, GodotSharp fails to compile with a whole bunch of errors like:

Godot.NativeInterop.NativeFuncs.generated.cs(1546,130): error CS0246: The type or namespace name 'r_str' could not be found (are you missing a using directive or an assembly reference?)

dotnet/roslyn#65606 which is included in the 7.0.200 SDK changed IParameterSymbol.ToDisplayString() to include the parameter name, after which we add a second parameter name, and the generator output fails to compile.

This PR uses the corresponding ParameterSyntax (which actually corresponds to source code and is not just intended for display to the user) instead. WithAttributeLists(default) is used to skip custom attributes int the generated output, which would duplicate them and possibly break (if we were to actually use any with the callbacks).

Future work: Audit all uses of ToDisplayString and replace them, as they appear to not be intended for generating source.

@RedworkDE RedworkDE requested a review from a team as a code owner February 15, 2023 17:23
@akien-mga akien-mga added this to the 4.0 milestone Feb 15, 2023
@akien-mga akien-mga merged commit 05fd229 into godotengine:master Feb 16, 2023
@akien-mga
Copy link
Member

Thanks!

@RedworkDE RedworkDE deleted the net-source-gen-param branch February 16, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants