-
Notifications
You must be signed in to change notification settings - Fork 8.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
Bugfix: serialize iterable commands #10373
Conversation
While working on this bugfix, I realized that another bug exists: {
"name": "${profile.name}",
"command": { "action": "newTab", "profile": "${profile.name}" },
"iterateOn": "profiles"
},
{
"name": "${profile.name}",
"commands": [ { "command": "newTab" } ]
} Here, the settings model exports these commands to the command palette as one entry in the name map (the iterable command). This is wrong though, because really the user is explicitly asking for a command named "${profile.name}". However, this bug already exists in v1.8, but in a different manifestation. Here's the encountered behaviors:
This bugfix brings us closer to a world where this new bug is fixed. We would need to mess with how we expand commands. But (a) that's too risky for a hotfix and (b) this is a really obscure bug. @DHowett Thoughts? |
I'd say just.. file it and we can move on. 😄 |
// copy _IterableCommands | ||
for (const auto& cmd : _IterableCommands) | ||
{ | ||
actionMap->_IterableCommands.Append(*(get_self<Command>(cmd)->Copy())); |
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.
qq: why do we need to keep them separate from the nested commands?
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.
Keeping them separate does half of the work for this bug.
Combining them keeps the same buggy behavior from v1.8/main.
Hello @carlos-zamora! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
## Summary of the Pull Request Fixes a bug where top-level iterable commands were not serialized. ## PR Checklist * [X] Closes #10365 * [X] Tests added/passed ## Detailed Description of the Pull Request / Additional comments - `Command::ToJson`: - iterable commands deserve the same treatment as nested commands - `ActionMap`: - Similar to how we store nested commands, iterable commands need to be handled separately from standard commands. Then, when generating the name map, we make sure we export the iterable commands at the same time we export the nested commands. (cherry picked from commit 9294ecc)
🎉 Handy links: |
🎉 Handy links: |
Summary of the Pull Request
Fixes a bug where top-level iterable commands were not serialized.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Command::ToJson
:ActionMap
: