The "alternative Matlab ide" aims at providing a full fledged Matlab user experience directly from VSCode.
This extension is a work in progress and features will be added as described in the Feature section bellow.
This extension is intended for Linux users (so most should work on MacOS).
Current version 0.5.1.
... though it might be if it comes for free ...
There is no intent to provide integration for toolboxes, application packaging or Simulink. These Matlab extensions are available through the Matlab command window.
There is no immediate intent to provide compatibility to Windows... not that I want to preclude from using Windows, but I just don't own one...
- Open the command palette using
Ctrl+Shift+P
- Type
aMi: Start Matlab
in the command palette
- Use the command window as usual
- Start scripts from either the file editor or file explorer using right click
and then selecting
Run Matlab file
- Execute selected code in the file editor using right click and then selecting
Run selection in Matlab command window
- Open the command palette using
Ctrl+Shift+P
- Type
aMi: Stop Matlab
in the command palette
- Open the command palette using
Ctrl+Shift+P
- Type
aMi: Start debug adaptor
in the command palette
- Use the stop button (red square) in the debug command widget.
There is no intent to provide syntax higlighting or linter in version 0. Other extensions can be used for this (Gimly81.matlab for instance).
Provide Matlab command window in a terminal.
Run .m file from editors or from the file explorer window.
Run current selection in the integrated command window.
Add remove breakpoints from editors (Matlab functions and scripts only).
Debug mode catches error and warning and pauses execution to allow debugging.
Explore the current workspace variables. Go up and down the execution stack when debugging.
Works "out of the box" with Windows, MacOS and Linux. Matlab editor by-passed.
Edit values from the workspace explorer.
Drill down profiler results.
Auto completion hints straight from the command window.
Stand alone syntax highlighter based on in situ Matlab installation.
Stand alone linter based on situ Matlab installation.
Run cells in the current command window.
Matlab must be installed on your computer and configured so that matlab
command starts it. This extension is built and tested using Matlab R2019a.
Backward compatibility is not granted though it should work smoothly as of
R2014b.
Matlab Engine API for Python (min 3.6) must be installed (follow these instructions).
None for now.
- When debug adaptor is started, variables of the selected stack workspace are now displayed in the variables tab of the debug pane.
- For release 0.5.1 arrays and cell arrays exploration support has been added. Structure and object support will be added in next release.
- Some error messages in the command window are printed incorrectly.
- Debugging files not in path (run file in place) does not work. Workaround is to add them to the path.
- Exception and warning catching can only be treated as an otherwise standard breakpoint. Error informations are only availble from the command window. There will probably not be any fix for this as this is linked to what information Matlab can programatically provide on the current debug state.
- Conda environments can preclude this extension to work properly. It will not work for instance if you have installed a recent Anaconda (using now Python3.7) and let the installer initialize your .bashrc file. To work this around, create an environment compatible with this extension and start VSCode from that one.
- Command history is lost when VSCode is closed before using
aMi: Stop Matlab
or terminating Matlab manualy from its command window (usingexit
). - The debug stop button (red square) is misleading as it forces the debug adaptor to shut down. If you want to stop debugging and return to the command window, use debug restart button instead (green rotating arrow). If you stop the debug adaptor by mistake, just restarting it should restore previous state. Note: there will be no fix to this as this is the behaviour enforced by the debug protocol.
- First undefined variable or function error in the command window catches
Matlab internal errors if
Caught Errors
option is set. - Altering the class of the content of a cell (in a cell array) can break VSCode variable explorer if that cell is displayed when the change is done. Workaround is to stop and restart the debug adaptor.
- Breakpoints remain set after the debug addaptor has been shut down (not sure
yet if this is an issue or desirable feature - feedback welcome). To clear all
breakpoints: re start debug adaptor and remove all breakpoints, or
alternatively enter
dbclear all
in the Matlab command window. - Shared session of Matlab can not be stopped cleanly from the Python API. The error raised at exit is simply ignored.