-
Notifications
You must be signed in to change notification settings - Fork 48
fix-163 Studio Context Actions command errored if no file open #164
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
fix-163 Studio Context Actions command errored if no file open #164
Conversation
I tried to make the "Studio Context Actions" menu in the explorer be similar to Studio's and only populate the context actions. Since there is no equivalent of a top menu in VSCode, the "Studio Actions" command was originally made to show both types of menus, so I did not change the behavior of that quickpick. It was not intentional to always show the context actions command. If it is okay to display both types of menus from the explorer context menu, then there would be no need to have the "Studio Context Actions" command (it's not used anywhere else). |
4a6c24a
to
5fce87a
Compare
@@ -128,11 +128,19 @@ | |||
"when": "false" | |||
}, | |||
{ | |||
"command": "vscode-objectscript.studio.actions", | |||
"command": "vscode-objectscript.serverCommands.sourceControl", |
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.
@gjsjohnmurray I don't like "sourceControl" here - maybe call it serverCommands.studioExtension? (The "studio extension" framework is more general than just source control.)
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.
@timleavitt with this PR I have implemented separate menus for the Source Control commands and the rest, to replicate how Studio behaves. This command brings up the %SourceMenu menu items, which Studio displays under a menu named "Source Control". The command vscode-objectscript.serverCommands.other
brings up the items from all other menus for which context=0.
vscode-objectscript.serverCommands.contextSourceControl
shows the %SourceContext menu's items, and vscode-objectscript.serverCommands.contextOther
shows all the other ones for which context=1
If you'd like to see this in action you can always get the vsix artifact that our CI pipeline creates whenever I push stuff to this PR:
Install this in your VS Code and give it a try. I'll be glad to have more of your feedback.
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.
@gjsjohnmurray thanks - that makes more sense now. I'll try it out when I get a chance.
PR to fix #163
@ty-d, @timleavitt before getting this PR merged I'd like to understand the different roles of the
vscode-objectscript.studio.actions
andvscode-objectscript.studio.contextActions
commands.The XData of %Studio.SourceControl.Base defines two menus:
I subclassed %Studio.SourceControl.Base and added an extra option at the beginning of each menu in order to differentiate them:
Studio uses the former for its menubar Source Control menu,
and the latter for the Source Control item on its context menus (i.e. right-click) on open documents
and items in trees in the Workspace panel:
In VS Code the
objectscript.studio.actions
command supplies the quickpick we get from VS Code context menus on isfs-scheme files in VS Code's native Explorer and on the editor of an open isfs-scheme file. Its caption isStudio Actions...
My test class results in this quickpick:
This lists the active entries from %SourceMenu followed by any active members from %SourceContext that haven't previously been added.
The
objectscript.studio.contextActions
command appears on the context menu of the ObjectScript Explorer view, Its caption is 'Studio Context Actions...` and populates my quickpick as follows:This lists active members from %SourceContext only.
From the above analysis I have several questions:
Why does an isfs item in ObjectScript Explorer have a different context-menu-initiated Studio Context Actions quickpick from the Studio Actions one on other context menus (editor/context and explorer/context)?
Why does one of those quickpicks (Studio Actions) include options from both XData Menus?
Was it intentional that the `ObjectScript: Studio Context Actions..." command always appeared in the Command Palette?
Re question 3, a change in this PR suppresses that command completely from the palette. But without understanding the thinking behind these two commands I'm not certain that's the correct thing to have done.