PSG - Bug fixes for interfaces such as IBrowser.h#240
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Plugin Skeleton Generator to better handle real-world Thunder interface headers (e.g., optional EXTERNAL, nested types/aliases used by notification signatures), improves notification code generation, and adds support for choosing an output directory.
Changes:
- Extend interface parsing to capture
usingaliases and nested type declarations for more robust parameter type qualification in generated notification code. - Add generation support for notification helper implementations in source, selective JSON “J*” includes, and optional OOP configuration scaffolding.
- Allow the generator to emit the plugin into a user-selected output directory and update scripts/templates accordingly.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| PluginSkeletonGenerator/utils/FileUtils.py | Adds a post-processing pass to normalize generated output around Metadata<...> token spacing. |
| PluginSkeletonGenerator/templates/.plugin_source.txt | Adds {{SOURCE_NOTIFY_IMPL}} injection point in generated source. |
| PluginSkeletonGenerator/templates/.plugin_implementation.txt | Adds placeholders for copied using aliases and optional OOP configure method emission. |
| PluginSkeletonGenerator/templates/.plugin_header.txt | Makes the “private members” access specifier driven by a placeholder. |
| PluginSkeletonGenerator/parser/Parser.py | Improves interface detection (EXTERNAL optional) and captures using aliases + nested type names. |
| PluginSkeletonGenerator/menu/Menu.py | Adds output directory prompt, stricter yes/no handling, and plugin-name validation. |
| PluginSkeletonGenerator/generators/PluginRepositoryGenerator.py | Writes generated plugin under output_dir/plugin_name instead of always CWD. |
| PluginSkeletonGenerator/data/FileData.py | Adds type-qualification helpers for notification params, deduped includes, event-only JSON includes, and in-process notification implementations. |
| PluginSkeletonGenerator/core/PluginBlueprint.py | Tracks @event notification entries separately and adds output_dir to blueprint. |
| PluginSkeletonGenerator/core/GeneratorCoordinator.py | Threads output_dir through to the blueprint. |
| PluginSkeletonGenerator/CombinedPlugins.sh | Updates scripted stdin answers to match the new prompts (output dir added). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @nxtum : All code files are supposed to have proper Apache headers please. |
it doesnt like the word token |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
|
b'## WARNING: A Blackduck scan failure has been waived A prior failure has been upvoted
|
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
VeithMetro
left a comment
There was a problem hiding this comment.
Good changes and many, many bug fixes, great job! I just found a few minor things in the generated plugins:
- Preconditions/Terminations/Controls collapsed into Preconditions only
Across all *Preconditions skeleton variants (e.g. InProcessConfigPreconditions), the generator now puts every subsystem into Preconditions and leaves Terminations/Controls empty - Unnecessary const_cast in Revoked handlers?
In multiple files (e.g. OutOfProcess.cpp), the Revoked handler applies const_cast to a pointer already returned as non-const by QueryInterface. Is this necessary as we cannot always tell whether that is const or not? Can't we detect that somehow? - Spacing before commas in subsystem lists
Minor formatting issue: { subsystem::GRAPHICS , subsystem::NOT_GRAPHICS , subsystem::TIME } has spaces before commas
template <typename REQUESTEDINTERFACE>
REQUESTEDINTERFACE* QueryInterface()
{
void* baseInterface(QueryInterface(REQUESTEDINTERFACE::ID));
if (baseInterface != nullptr) {
return (reinterpret_cast<REQUESTEDINTERFACE*>(baseInterface));
}
return (nullptr);
}
template <typename REQUESTEDINTERFACE>
const REQUESTEDINTERFACE* QueryInterface() const
{
const void* baseInterface(const_cast<IUnknown*>(this)->QueryInterface(REQUESTEDINTERFACE::ID));
if (baseInterface != nullptr) {
return (reinterpret_cast<const REQUESTEDINTERFACE*>(baseInterface));
}
return (nullptr);
}As remote is a const Core::IUnknown* const REQUESTEDINTERFACE* QueryInterface() const and since then the unregister method wants an interface that is not const, the constcast is needed here |
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Plugin skeleton preview (latest run): AI summary of generated diff: |
VeithMetro
left a comment
There was a problem hiding this comment.
One last thing, it does not compile now, because we changed to C++17 lately, and we use it in Thunder now 😄 You have to make sure that the CMake files that are generated don't have C++11 hardcoded as they do now
No description provided.