bramvbilsen / Matlab-Code-Run-for-VS-Code

This repo contains the code for the "Matlab Code Run" extension for Visual Studio Code,
25 stars 5 forks source link

[Mac OSX] Got " command 'extension.runMatlab' not found" error #2

Open MySadCaptain opened 5 years ago

MySadCaptain commented 5 years ago

macOS 10.14.5 VScode 1.35.1 MATLAB R2018b

I can run matlab in terminal with command "matlab -nodesktop -nosplash -r "test"" image

And also set the matlab path in the vscode settings. image

When I use "Run Matlab File", I got error "command 'extension.runMatlab' not found". image

Any idea how to solve it?

IamPhytan commented 5 years ago

Was it in Folder mode or in File Mode ?

MySadCaptain commented 5 years ago

Was it in Folder mode or in File Mode ?

@IamPhytan Thanks for suggestion!I tried run the command in Folder mode, it worked! It seems have to set the working directory first to make this command work. Any way to make it work also in the file mode?

IamPhytan commented 5 years ago

@MySadCaptain, if I look at the code, this extension is setting a workspace everytime it is runned, which means that it was made for folder mode.

I don't know how to discriminate between the two modes with VS Code API, but I could make a pull request that calls matlab differently if you are on Mac. It is pretty much the same procedure as my last pull requests.

MySadCaptain commented 5 years ago

@IamPhytan Thank you! It would be great if you can make a pull request.

I did a little search and found that this post mentioned that can make a dynamic working directory by add "cwd": "${fileDirname}" in the launch.json, but it's for debug mode. Also there is a tasks.json seems can also add this configuration. I haven't figure out how to make it work.

7vik03 commented 2 years ago

@IamPhytan I don't understand, what is a Folder Mode? (I'm new to this whole software thing). Also, @MySadCaptain, how are you running MATLAB only by using the command matlab because for me it says, 'No command matlab'.