CMakeSonar VS Code Extension
This extension runs CMakeSonar and shows diagnostics directly in VS Code for:
Quick start
- Open folder
vscode-cmakesonar in terminal.
- Install dependencies:
- Compile extension:
- Press
F5 in VS Code to launch Extension Development Host.
Bundle mode (download and use directly)
This extension now bundles the Python analyzer from the workspace root:
cmakesonar_vscode_analyze.py
cmakesonar/
Default analyzer path is:
./bundled/python/cmakesonar_vscode_analyze.py
So users installing VSIX / Marketplace version can run directly after configuring a usable Python interpreter.
Commands
CMakeSonar: Analyze Current File
CMakeSonar: Analyze Workspace
CMakeSonar: Show Output
Added capabilities
- Auto analysis on save (
runOnSave)
- Incremental workspace analysis (only changed files)
- Dedicated output panel for logs and errors
Settings
cmakeSonar.pythonPath: Python executable (default: python)
cmakeSonar.analyzerScriptPath: path to analyzer script (default: ../cmakesonar_vscode_analyze.py)
cmakeSonar.runOnSave: run automatically on save
cmakeSonar.runOnOpen: run automatically on open
cmakeSonar.incrementalWorkspaceAnalysis: enable incremental mode for workspace scans
One-click VSIX packaging
- Run
npm run build:vsix in this extension folder
- The
.vsix package will be generated in the extension folder
Internal test flow (recommended before publish)
npm install
npm run build:vsix
- In VS Code: install from VSIX
- Open a CMake workspace and test diagnostics:
CMakeSonar: Analyze Current File
CMakeSonar: Analyze Workspace
- Verify red squiggles and Problems panel diagnostics.
Marketplace publish checklist
Before publishing, update these fields in package.json:
publisher (your real publisher ID)
repository.url
homepage
bugs.url
Then publish:
npm install
npm run compile
vsce login <publisher>
npm run publish:marketplace
| |