vscode-matlab
vscode-matlab copied to clipboard
Support non absolute path for mlint
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",
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.
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, 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.