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

GD0001: partial modifier static analysis for Godot 4 #81

Closed
Sythelux opened this issue Sep 19, 2022 · 7 comments · Fixed by godotengine/godot#87253
Closed

GD0001: partial modifier static analysis for Godot 4 #81

Sythelux opened this issue Sep 19, 2022 · 7 comments · Fixed by godotengine/godot#87253
Labels
good first issue Good for newcomers

Comments

@Sythelux
Copy link

Godot 4 now requires anything inheriting from Godot.Object to be partial. The Plugin doesn't recognise this, yet

example code:

public class Main : Node3D
{
	public override void _Ready()
	{
		GD.Print("_Ready");
	}
}

This looks fine in Rider, but when building in Godot it yields:

[...]\Main.cs(4,1): Error GD0001 : Missing partial modifier on declaration of type 'Main' which is a subclass of 'Godot.Object'

It would be good to have a static analysis of Rider to show that error in the editor before building.

@Sythelux Sythelux changed the title Static analysis for Godot 4 GD0001: partial modifier static analysis for Godot 4 Sep 19, 2022
@van800
Copy link
Collaborator

van800 commented Sep 20, 2022

I think it might be worth implementing such a roslyn analyser in the Godot source itself, somewhere near the source generator, which produces that error.
That way all IDE-s (including Rider) would automatically display the error.

@Sythelux
Copy link
Author

I think it might be worth implementing such a roslyn analyser in the Godot source itself, somewhere near the source generator, which produces that error. That way all IDE-s (including Rider) would automatically display the error.

can you point me to a typical roslyn implementation in another repo or the Roslyn doc for that? This sounds like an Issue I would be able to solve in the core.

@van800
Copy link
Collaborator

van800 commented Sep 20, 2022

Try looking in https://github.com/microsoft/Microsoft.Unity.Analyzers

@van800 van800 added the good first issue Good for newcomers label Jul 9, 2023
@van800
Copy link
Collaborator

van800 commented Jan 16, 2024

Should be implemented in the engine similar to godotengine/godot#79007

@van800
Copy link
Collaborator

van800 commented Jan 16, 2024

I have started making a pull request godotengine/godot#87253, currently in discussion.

@van800
Copy link
Collaborator

van800 commented Feb 21, 2024

Merged today.

@Sythelux
Copy link
Author

I followed the discussions about it in the godot project and the refactoring it lead to. Thank you a lot of taking care if it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants