MATLAB-extension-for-vscode icon indicating copy to clipboard operation
MATLAB-extension-for-vscode copied to clipboard

`edit()` and opens files in MATLAB editor

Open Titas22 opened this issue 10 months ago • 2 comments

Using edit() or open() opens files in MATLAB editor instead of VSCode

Example:

edit whos

Titas22 avatar Apr 03 '24 17:04 Titas22

Thanks for the feedback! This is definitely something we will consider supporting in a future release.

philipb314 avatar Apr 03 '24 17:04 philipb314

One (almost) workaround for this is to create a custom mfile.m function in C:\Program Files\MATLAB\MATLAB_VERSION\toolbox\matlab\codetools\+matlab\+codetools\+internal\+edit\:

function mfile(file, ~)
    if exist(file , 'file')
        system(['code "', which(file), '"']);
    end
end

It opens the .m files in VSCode when called from MATLAB editor, however in VSCode it throws an error as reported in #126

Titas22 avatar Apr 03 '24 17:04 Titas22