-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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#: Add a Roslyn analyzer for global classes #79007
C#: Add a Roslyn analyzer for global classes #79007
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to the .NET module! This is looking great, I think it can be very helpful to have an analyzer for this.
Adding errors where there weren't before breaks source compat. But the analyzer adds errors to code that used to be invalid or otherwise would not work as expected, so I think we're OK with the breaking change.
Also, since you are a new contributor, make sure to read CONTRIBUTING.md and the contributing documentation if you haven't already.
You'll need to squash the commits before this PR can be merged. The contributing documentation contains information about squashing in case you need it.
Feel free to reach out in the development chat if you need help.
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GlobalClassAnalyzer.cs
Outdated
Show resolved
Hide resolved
c86c600
to
2115721
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already looks great. I only added a few comments about the diagnostic messages to try and be consistent with existing diagnostic messages.
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
7a6754d
to
be49715
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you very much!
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
Outdated
Show resolved
Hide resolved
Co-Authored-By: Raul Santos <raulsntos@gmail.com>
0e1bec2
to
8e56c80
Compare
Thanks! And congrats on your first merged Godot PR, I believe! |
Should help clarify things to those who aren't as familiar with the core engine. This helps prevent one of many likely scenarios of the following from successfully compiling but not showing up in the editor (or even causing future crashes):