vscode-matlab icon indicating copy to clipboard operation
vscode-matlab copied to clipboard

Support non absolute path for mlint

Open freed00m opened this issue 7 years ago • 3 comments

Hi,

I am used to version my config in git and not all my machines has the same username and I would like to have identical vscode config on all.

What options won't work

"matlab.mlintpath": "$HOME/.local/MATLAB/bin/glnxa64/mlint",
"matlab.mlintpath": "~/.local/MATLAB/bin/glnxa64/mlint",

What does work

"matlab.mlintpath": "/home/frdm/.local/MATLAB/bin/glnxa64/mlint",

freed00m avatar Mar 26 '18 14:03 freed00m

Given the traffic on the main VSCode repo here, it seems like this needs to be implemented at the extension level (e.g. DonJayamanne's Python Extension) and is not currently part of VSCode natively.

sco1 avatar Mar 27 '18 02:03 sco1

I'll take a look at modifying this, seems like a relatively quick fix. It's just a bit annoying to fix at the extension level something that should, and probably will, be fixed in VSCode directly. I'm wondering if it would not be better to wait...

Gimly avatar Apr 16 '18 20:04 Gimly

@Gimly, I'm running into the same issue but I have something else in mind as a fix.

I wonder why we should check if the file exists at all (if (!fs.existsSync(mlintPath)) in matlabMain). In my case, I made it so that mlint is a symlink in ~/bin that can be executed anywhere, so my mlintPath should just be mlint. Why can't we just make sure mlintPath not empty or null, and then execute it as a command, and if there's an error, catch it then. This means that it doesn't have to be a file per se but an executable command.

linhtto avatar Aug 27 '18 06:08 linhtto