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
234 stars 15 forks source link

Using matlab from a docker container #60

Open diegoferigo opened 1 year ago

diegoferigo commented 1 year ago

Is your feature request related to a problem? Please describe.

I'd like to use Matlab included in a docker container, like those that can be instantiated using mathworks-ref-arch/matlab-dockerfile.

Currently, this extension expects Matlab to be installed in the host OS.

Screenshot_20230922_150159

Describe the solution you'd like

I'd like vscode to use Matlab included in a docker container running in my system.

hamidingit commented 1 year ago

Thanks for your enhancement request. Have you considered using a setup like https://code.visualstudio.com/docs/remote/ssh ? You would be including a VS Code IDE and MATLAB extension on your Docker container and then use VS Code's SSH extension to remote into the docker container. would that work for you?

diegoferigo commented 1 year ago

Thanks @hamidingit for your input! That is similar to my current setup, in which I install VS Code inside the Docker image. The only difference is that, being on the same machine, I use directly the host's X server by creating a matching user and sharing the resources for X11 authentication.

While these two solutions work perfectly fine, I was wondering with this feature request if a setup based on Dev Containers (docs) would be supported anytime in the future. Right now, even if the MATLAB extension is configured to be installed inside the dev container, it is not able to find the included matlab installation and provide full hints.

Edit: I forgot to mention that I'm already on a GNU/Linux system, and my setup works only if this is the case, contrarily to the ssh option.