Skip to content

Latest commit

 

History

History
92 lines (67 loc) · 6.13 KB

README.md

File metadata and controls

92 lines (67 loc) · 6.13 KB

mcpp logo

mcpp for VS Code

English | 简体中文

The VS Code front end for the mcpp C++23 build tool: project discovery, mcpp build / run / test / clean as VS Code tasks, toolchain management, mcpp.toml and build.mcpp editing help, the package library view, and cache views with graded cleanup. C++ module semantics — diagnostics, completion, hover, definitions, references, the module graph — come from sunrisepeak.mcpp-language-server; this extension never starts an LSP client of its own and only forwards to it (docs/architecture.md).

Related projects

Project What it is Where
mcpp The C++23 build tool this extension drives —
mcpp-language-server The C++ Modules language service; a hard dependency of this extension Marketplace · Open VSX
mcpp-vscode (this extension) The VS Code front end Marketplace · Open VSX · Releases

See dependency graph navigation and exports for entry groups, importer depth, refresh behavior and SVG/PNG export.

Install

Any of the three channels installs the same extension:

  • Marketplace: the link above, or search "mcpp" inside VS Code.
  • Open VSX: the link above (VSCodium, Gitpod and friends; listed from 0.6.0 on).
  • GitHub Releases: download the VSIX, then Extensions: Install from VSIX..., or code --install-extension mcpp-vscode-<version>.vsix.

package.json declares extensionDependencies: ["sunrisepeak.mcpp-language-server"], so VS Code installs that extension automatically where a platform package exists — the field only accepts an extension id, no version range (docs/compatibility.md).

Platform mcppls package This extension
linux-x64, linux-arm64, darwin-arm64, win32-x64 yes yes
darwin-x64, win32-arm64 no package not activated

Quick start

  1. Open a folder containing an mcpp.toml (or run mcpp: New Project).
  2. Run mcpp: Build (mcpp.build); it runs in a dedicated task terminal.
  3. Open the mcpp activity-bar container: Project, Libraries and Cache (collapsed by default); the C++ Modules status and actions live in Project → Basics.

Opening a project never runs mcpp on its own and never downloads a toolchain.

Features

  • mcpp CLI and tasks — build, run, test, clean, the quick menu, toolchains: docs/commands.md.
  • mcpp.toml editing — completion of tables, keys, values and dependency versions, hovers, go-to-definition, seven structural diagnostics, no formatting, from the mcpp-ide backend's rules layer: docs/rules.md.
  • build.mcpp help — build.mcpp is a cpp file that C++ Modules compiles as the build program; the backend's rules layer adds the mcpp::… directive completion, hovers and snippets and the SPEC-007 rule checks no compiler makes: docs/rules.md.
  • Libraries — browse the official mcpp-index offline, choose a target project and dependency type, and view available versions and verified example code. Other registry hits have separate previews. See Libraries.
  • Cache views and cleanup — project artifacts and the shared build cache, previewed before anything is deleted: docs/cache.md.
  • C++ Modules — the other extension's state and actions, in the project view and the status-bar menu, forwarded not reimplemented: docs/commands.md.
  • Debug, tests, targets, packing — mcpp: Debug and the mcpp launch type (CodeLLDB, the C/C++ extension or lldb-dap), the Testing tree, mcpp: Select the Build Target (target sets among its rows with mcpp 2026.10.30.1 and later), mcpp: Pack, and build on save (mcpp.build.onSave).
  • Settings and diagnostics — a registry-backed settings panel (mcpp.openSettings) and a copyable environment self-check (mcpp.selfCheck): docs/settings.md. mcpp.ui.language overrides our messages and panels only; palette titles always follow VS Code (docs/architecture.md).

The backend

The extension carries the mcpp-ide backend (backend/: one ok-image bundle and okrun for Linux x64/arm64, macOS arm64 and Windows x64) and runs mcpp and mcppls through it; mcpp.backendPath names another. The CLion plugin shows the same pages over the same backend.

Troubleshooting

Look first at the mcpp output channel, then run mcpp: Environment Self-check (mcpp.selfCheck). The common cases — the dependency is missing, the language service stays on "no status yet", mcpp.path versus PATH, a build that finished without refreshing the language service — are in docs/troubleshooting.md.

Development

npm ci, npm run compile, npm test (the gates first, then the unit tests, the parity gates against 0.9.0 among them), npm run test:e2e, npm run test:webui (the CLion workbench in Chromium), npm run gen (the declarations from the repository's spec/), npm run package, and node tools/dev-profile.mjs for a throwaway profile under .dev-profile/ that never touches your real one.

Release: the extension is released with mcpp-ide (a v<version> tag of that repository). The workflow runs the tests, packages one VSIX with the backend, and publishes that same artifact to GitHub Releases and Open VSX. Upload that VSIX manually through the Visual Studio Marketplace publisher portal.

License

Apache-2.0 — see LICENSE.