-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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#: Implement tooltips for Signals and Properties in the inspector. #83505
base: master
Are you sure you want to change the base?
Conversation
3c6209c
to
b0a3350
Compare
Would it be possible to reuse this implementation for documentation of GDShader |
9c21641
to
943ddbc
Compare
601893f
to
4f4ee11
Compare
If this gets approved, it looks like worth setting |
Removing the documentation label, as while this PR deals with documentation generation/display, this is more suited for the dotnet team to handle :) |
02a0e02
to
dd8605f
Compare
Remove the need for |
f29bbca
to
db2f047
Compare
Hi @anvilfolk ! |
No worries. I can also speak portuguese, french and some spanish if that is better. I am making progress on the other PR! Hope to see C# documentation working soon! <3 |
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Show resolved
Hide resolved
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 your patience and continued work on this feature. This is already looking pretty good, so I'm moving it to the 4.4 milestone because it seems likely to be finished on time and we want to include it in the next stable release.
However, keep in mind this is not a guarantee that it will be in the 4.4 release, it may still be pushed to a future release if we run into issues.
Also, would you be able to add tests for the new generator in Godot.SourceGenerators.Tests
? This will help ensure that future changes to the generator don't change the generated code in unexpected ways.
modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs
Outdated
Show resolved
Hide resolved
editor/editor_file_system.cpp
Outdated
bool should_reload_script = _should_reload_script(path); | ||
Ref<Script> scr = ResourceLoader::load(path); | ||
if (scr.is_null()) { | ||
continue; | ||
} | ||
if (should_reload_script) { | ||
// Reloading the script from disk. Otherwise, the ResourceLoader::load will | ||
// return the last loaded version of the script (without the modifications). | ||
scr->reload_from_file(); | ||
if (lang->get_name() != "C#") { | ||
bool should_reload_script = _should_reload_script(path); | ||
if (should_reload_script) { | ||
// Reloading the script from disk. Otherwise, the ResourceLoader::load will | ||
// return the last loaded version of the script (without the modifications). | ||
scr->reload_from_file(); | ||
} |
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.
These changes don't seem to be needed, so I would revert them.
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.
- Modify the code in VS.
- Rebuild in Godot.
- This will execute
reload_from_file
. - Then, GodotSharp will throw an error about
_scriptTypeBiMap
being added multiple times.
Because of lang->supports_documentation()
, C# will never execute here.
However, this PR adds supports_documentation()
.
If we don't include it, we'll need to modify _should_reload_script
.
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.
@magian1127 This still needs to be addressed. In my testing it didn't seem to be needed, but I could be missing something, so if you still think it's needed could you explain why? Thank you.
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.
Yeah, I'd hate to see code like this start getting added, especially if folks end up adding more scripting languages in the future.
We should eventually all get together and figure out what a good doc-generation architecture might be. It probably wants to live inside Script
, ScriptLanguage
and ScriptServer
, which would abstract it away nicely and not require special cases!
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.
@magian1127 Thanks, I'm able to reproduce the exception. I understand why you made this change now.
Reloading a C# script checks if the script is already registered before trying to register it again. So if it still throws after that, it must mean the script is different, and that's a bug. There must always be only one CSharpScript
instance for each C# type, so if another one is being created somewhere we need to find where.
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.
The potentially related PR #98269
2cf3331
to
b39f2b6
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.
The latest changes look good, although there's still an unresolved comment. I added a few more comments, but it should be the last batch and then we can move on to a code-style review.
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/ScriptDocsGeneratorTests.cs
Outdated
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ClassDoc.cs
Show resolved
Hide resolved
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptDocsGenerator.cs
Outdated
Show resolved
Hide resolved
|
😓 Some comments have not been replied to because the 'Review changes' button in the upper right corner was not clicked. |
resolve godotengine/godot-proposals#8269