-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implement conditional bindings #14
Conversation
This is cause by the timing of setContext in onDidHide method. By the time setContext is done, the isHiding is turned back to true by the hide method; hence, disposed the QuickPick.
- This reuses BaseCollectionMenuItem - This also fixes a bug where the equality check of overrides for conditional bindings were incorrect
@marcoieni Is there any update on this? I would like to merge it and unblock the task on the VSpaceCode repo to implement |
I procrastinated a little bird here, sorry, I was planning to do it in the next hours :) |
I tried to improve a little bit the README, but in my opinion the syntax is a little bit too complicated to be easily understand. I am sure you had valid reasons for your design choices, but in the following I will write down some things that seemed strange to me the first time I read them: key and serialization
examplesthis: {
"key": "when:sideBarVisible && explorerViewletVisible",
"name": "Hide explorer",
"type": "command",
"command": "workbench.action.toggleSidebarVisibility"
} might become this: {
"condition": {
"when": "sideBarVisible && explorerViewletVisible"
},
"name": "Hide explorer",
"type": "command",
"command": "workbench.action.toggleSidebarVisibility"
} and this: {
"key": "languageId:javascript;when:sideBarVisible",
"name": "Open file",
"type": "command",
"command": "workbench.action.files.openFileFolder"
}, might become this: {
"condition": {
"languageId": "javascript",
"when": "sideBarVisible"
},
"name": "Open file",
"type": "command",
"command": "workbench.action.files.openFileFolder"
}, Other stuff, WIP |
That's why I marked this as experimental for now, and change it if we need to. I don't like the reusing of the key I explained the serialization because the same serialization is used for both |
Ok, so we keep
If we keep this syntax is ok to explain it of course.
We decided to keep Overall, since we decided to not change the implementation at the moment, I think that the README is ok as it is (except one comment I will do in the code in a couple of minutes). |
If that's clearer :) Thank you for reading the issue and working with me :) |
README.md
Outdated
} | ||
``` | ||
|
||
You can then define the follow bindings that uses that specific `key` and `when`. |
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 and the following json are not very clear to me.
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.
Updated, let me know the updated version is clearer :)
If
no problem, thank you for working on this, it will enable really great stuff :) |
I will fix them later today, and we can look at them again tomorrow :) I know it's probably late in your time zone. |
Ok, with your changes it was a lot clearer, thanks! I also hidden the section by default, since it is very long and experimental. In this way users are not forced to read it. |
Thank you for working on it. Can't wait to the features on VSpaceCode that can build on top of it🚢 ship it. |
Close #11
@marcoieni It would be nice if you can look at the README and see if conditional binding makes sense to you.