Open Gusmano-2-OSU opened 2 weeks ago
Hi @Gusmano-2-OSU, thanks for working on this! I will plan to take a look at this soon (likely early next week).
Before I take a look, I just wanted to clarify - you are having some difficulty getting the "MATLAB: Open File" option added into the context menu?
Hey @dklilley, that's exactly right! The idea is, you right click any file supported by MATLAB's open
command, and you get a context menu command that lets you run the command on that file. As someone who works a lot with figures and Simulink models, I'm hoping it can significantly increase the speed of my workflow!
My dream implementation of this is that a normal click would open these files as a tab in the current vs code window, but it would definitely be good enough if they opened in a separate MATLAB window.
Thanks for taking a look!
I believe that the issue is just with where the configuration for the context menu item was being added within package.json
. Take a look at my comment and see if it helps!
Hey @dklilley, thanks for the suggestions! I was able to get it to work with the tips you gave. As I tried it out though, I thought it would be a little slow to open one at a time, so I tried adding functionality to select multiple files, and then executing the command to open all of them. I think there's a slight issue with the for loop, but I'm requesting the review anyway to show that the last problem was fixed! Do you have any suggestions on how to fix for
loop issue?
I don't think there are any issues with the loop as you have written it. Instead, even if there are multiple files selected in the Explorer, only one URI is passed to the command.
Unfortunately, after some digging, I don't believe that this is functionality which is publicly available for extensions to leverage.
While there are some context menu actions which do work with multiple files selected (e.g. Open to the Side
), these are commands provided my Microsoft and are implemented internally (e.g. the implementation of Open to the Side
leverages an internal getMultiSelectedResources
API).
That's too bad - maybe a project for another day if we could ever use the getMultiSelectedResources
API. For now, I've reverted the commit and this should be ready to pull!
Agreed - hopefully they add some public functionality soon!
The changes look good to me! One of my colleagues will be reaching out soon with information about signing the CLA.
Hi. Thanks for the contribution! Can you contact me about signing the CLA? I can help from there. Thanks.
I sent you an email, @nothans!
Implements opening
.fig
,.slx
and other MATLAB files through VS code's context menu.Note! I'm brand new to developing in TypeScript, and I'm having some implementation issues (specifically, getting the menu option to occur in the context menu.) Still, I wanted to put this here in case @dklilley or any of the other maintainers want to help with the final steps!