mathworks / MATLAB-extension-for-vscode

This extension provides support for editing MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis, navigation support, and more.
https://marketplace.visualstudio.com/items?itemName=MathWorks.language-matlab
MIT License
242 stars 16 forks source link

Feature request: select MATLAB install path #10

Open geerligs opened 1 year ago

geerligs commented 1 year ago

Hello,

thanks for this first release of the MATLAB VS Code extension, it is very welcome!

As I have multiple MATLAB installations installed I'd like to be able to select one of these. This is implemented in the Python extension for VS Code. It is is possible to select a default interpreter and also add multiple interpreters. Also Python interpreters are detected automatically.

It would be nice to have similar functionality for MATLAB VS Code extension.

Keep up the good work!

--Han

dklilley commented 1 year ago

Are you referring to the "Python: Select Interpreter" command in VS Code?

Currently you can change the MATLAB installation being used via the matlab.installPath setting by providing a path, similar to the python.defaultInterpreterPath setting.

geerligs commented 1 year ago

Hi Duncan,

thanks for your prompt response.

I did mention "Python: Select Interpreter" as an example how to control the matlab.installPath setting.

As an example: I have installed several Python interpreters, image

The default one is 3.7, as shown below: image

However I am able to select 3.9.7, 3.8.3. etc. It would be nice when the MATLAB extension would have a setting for default, while enabling the user to switch to another MATLAB version. Maybe you could add automatic detection, looking for MATLAB in default locations ("C:\Program Files\MATLAB" for 64 bit, "C:\Program Files (x86)\MATLAB" for 32 bit) and using the settings of PATH.

Hope this clarifies the feature request.

--Han

geerligs commented 4 days ago

It is now possible to save the MATLAB.InstallPath in the Workspace setting. Due to precedence of Workspace settings over User settings it is easy to use a specific Matlab version on a per folder basis.

It is not as versatile as my proposal to add automatic detection and selection of the MATLAB version but surely helps.