Doesn't support codeAnalyzerConfiguration.json
Describe the bug The VS Code extension doesn't seem to honor custom codeAnalyzerConfiguration.json.
Maybe this is user error, but I think I've done everything right.
In this screenshot, you can see: a) VS Code editor shows a single issue. This is one that comes out of the box b) the Terminal is showing the output of codeIssues on this folder. It shows 4 issues - adding 3 from the configuration
To Reproduce I've attached a sample repo. It has a single MATLAB code file and resources\codeAnalyzerConfiguration.json: customCodeIssuesVSCode.zip
- Unzip attachment, open folder in VS Code
-
cdinto resources, runmatlab.codeanalysis.validateConfigurationStepsto verifycodeAnalyzerConfiguration.jsonis configured correctly -
cdback to root, runmatlab.codeanalysis.refreshConfigurationto ensure the configuration is applied - Run
c=codeIssues;c.Tableto see the list of issues. You should see four - Look in the editor. Should see four issues, but you will only see 1 (if get the same result as me)
Expected behavior
I expect this to behave the same as desktop MATLAB editor, which I have verified shows the issues. This screenshot is from the same session of MATLAB (launched from VS Code with desktop)
Useful Information
- MATLAB Version: 25.1 (R2025a, Update 1)
- OS Version: macOS 15.6.1
- VS Code Version: 1.102.2
This appears to be the case because checkcode is not returning the diagnostics which are stemming from this configuration. It is possible to get these diagnostics by using the -config option in checkcode, as below:
checkcode('thisIsMyVeryShortFunctionWithAVeryLongName.m', '-config=./resources/codeAnalyzerConfiguration.json')
However, this requires knowledge of these configuration files existing. Alternatively, we may need to change the linting implementation to leverage codeIssues instead of checkcode for R2022b and later.