This extension runs CMakeSonar and shows diagnostics directly in VS Code for:
CMakeLists.txt*.cmake
Quick start
- Open folder
vscode-cmakesonarin terminal. - Install dependencies:
npm install
- Compile extension:
npm run compile
- Press
F5in 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.pycmakesonar/
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 FileCMakeSonar: Analyze WorkspaceCMakeSonar: 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 savecmakeSonar.runOnOpen: run automatically on opencmakeSonar.incrementalWorkspaceAnalysis: enable incremental mode for workspace scans
One-click VSIX packaging
- Run
npm run build:vsixin this extension folder - The
.vsixpackage will be generated in the extension folder
Internal test flow (recommended before publish)
npm installnpm run build:vsix- In VS Code: install from VSIX
- Open a CMake workspace and test diagnostics:
CMakeSonar: Analyze Current FileCMakeSonar: 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.urlhomepagebugs.url
Then publish:
npm installnpm run compilevsce login <publisher>npm run publish:marketplace