Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 67 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
name: backend
path: backend

# The VS Code extension: unit tests (the wire, the mappings) and the shared panels in a DOM, both
# The VS Code extension (mide-plugins/vscode): unit tests (the wire, the mappings) and the shared panels in a DOM, both
# against the backend built here; the extension in a real VS Code (the oldest it supports) over the
# mock mcpp, with that backend and with the bundle it carries; then the package, and its file list.
vscode:
Expand All @@ -101,7 +101,7 @@ jobs:
with:
node-version: 22
cache: npm
cache-dependency-path: vscode/package-lock.json
cache-dependency-path: mide-plugins/vscode/package-lock.json
- uses: actions/download-artifact@v5
with:
name: backend
Expand All @@ -115,19 +115,19 @@ jobs:
echo "MCPP_IDE_OKRUN=$GITHUB_WORKSPACE/backend/okrun"
} >> "$GITHUB_ENV"
- name: Install
working-directory: vscode
working-directory: mide-plugins/vscode
run: npm ci
- name: Unit and panel tests
working-directory: vscode
working-directory: mide-plugins/vscode
run: npm test
- name: The panels type-check
working-directory: vscode
working-directory: mide-plugins/vscode
run: npm run check:webui
- name: The extension in VS Code ${{ env.VSCODE_VERSION }}
working-directory: vscode
working-directory: mide-plugins/vscode
run: xvfb-run -a npm run test:e2e
- name: Package
working-directory: vscode
working-directory: mide-plugins/vscode
run: |
npm run package
(cd dist/extension && npx vsce ls --no-dependencies) | tee files.txt
Expand All @@ -138,12 +138,13 @@ jobs:
- uses: actions/upload-artifact@v5
with:
name: mcpp-vscode-vsix
path: vscode/dist/*.vsix
path: mide-plugins/vscode/dist/*.vsix

# The CLion plugin: its tests (the wire and a session over the mock mcpp), the archive carrying the
# bundle and every system's okrun, and the Plugin Verifier against the oldest CLion it claims
# (2025.2) and the one it is built on.
jetbrains:
# The CLion plugin (mide-plugins/clion; the protocol's editor `jetbrains`, the IntelliJ platform):
# its tests (the wire and a session over the mock mcpp), the archive carrying the bundle and every
# system's okrun, and the Plugin Verifier against the oldest CLion it claims (2026.1) and the one it
# is built on.
clion:
name: CLion plugin
needs: backend
runs-on: ubuntu-24.04
Expand All @@ -159,7 +160,7 @@ jobs:
- uses: actions/cache@v5
with:
path: ~/.gradle/caches/modules-2
key: gradle-clion-${{ hashFiles('jetbrains/gradle.properties', 'jetbrains/build.gradle.kts', 'jetbrains/settings.gradle.kts') }}
key: gradle-clion-${{ hashFiles('mide-plugins/clion/gradle.properties', 'mide-plugins/clion/build.gradle.kts', 'mide-plugins/clion/settings.gradle.kts') }}
- uses: actions/download-artifact@v5
with:
name: backend
Expand All @@ -178,13 +179,13 @@ jobs:
echo "MCPP_IDE_OKRUN=$GITHUB_WORKSPACE/backend/okrun"
} >> "$GITHUB_ENV"
- name: Test and package
working-directory: jetbrains
working-directory: mide-plugins/clion
run: gradle --no-daemon test buildPlugin
- name: Plugin Verifier
working-directory: jetbrains
working-directory: mide-plugins/clion
run: gradle --no-daemon verifyPlugin
- name: The archive carries the bundle and every system's okrun
working-directory: jetbrains
working-directory: mide-plugins/clion
run: |
unzip -l build/distributions/mcpp-clion-*.zip | tee files.txt
grep -q "mcpp-clion/backend/mcpp-ide.okb" files.txt
Expand All @@ -194,14 +195,62 @@ jobs:
- uses: actions/upload-artifact@v5
with:
name: mcpp-clion-zip
path: jetbrains/build/distributions/*.zip
path: mide-plugins/clion/build/distributions/*.zip

# The Neovim plugin (mide-plugins/nvim) in a headless Neovim, against the backend built here: over
# the mock mcpp on the oldest and the newest Neovim it supports, then over the real mcpp, which
# builds the test's project. Neovim comes from xlings (`nvim` in xim-pkgindex), each version
# installed and selected with `xlings use`, as mcppls's CI provisions it.
nvim:
name: Neovim plugin
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
NVIM_VERSIONS: 0.10.4 0.12.5
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-mcpp
- name: Build the backend and the mock mcpp
run: mcpp build
- name: Neovim from xlings
run: |
set -euo pipefail
for version in $NVIM_VERSIONS; do
for attempt in 1 2 3; do
if xlings install "nvim@$version" -y -g; then break; fi
[ "$attempt" = 3 ] && { echo "::error::nvim@$version could not be installed"; exit 1; }
sleep 30
done
done
# Neovim runs outside the repository: inside it, xlings resolves tools through the project's
# own subos (.xlings.json), which holds mcpp only. The suite finds the backend by its own path.
- name: The plugin on each Neovim, over the mock mcpp
working-directory: ${{ runner.temp }}
run: |
set -euo pipefail
failed=''
for version in $NVIM_VERSIONS; do
xlings use nvim "$version"
nvim --version | head -1 | tee said.txt
grep -qF "v$version" said.txt
echo "::group::Neovim $version"
nvim --headless --clean -l "$GITHUB_WORKSPACE/mide-plugins/nvim/tests/smoke.lua" || failed="$failed $version"
echo "::endgroup::"
done
if [ -n "$failed" ]; then echo "::error::the Neovim plugin failed on:$failed"; exit 1; fi
- name: The plugin over the real mcpp
working-directory: ${{ runner.temp }}
run: MCPP_NVIM_MCPP="$(command -v mcpp)" nvim --headless --clean -l "$GITHUB_WORKSPACE/mide-plugins/nvim/tests/smoke.lua"

# The packages, opened on every system they serve: the one bundle each editor package carries,
# started by the okrun it carries for that system (scripts/check-package.sh), and the backend's own
# universal package started by its launcher.
packages:
name: packages on ${{ matrix.os }}
needs: [vscode, jetbrains]
needs: [vscode, clion]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
Expand Down
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
target/
.mcpp/
node_modules/
vscode/dist/
vscode/out/
vscode/*.vsix
vscode/bin/
jetbrains/build/
jetbrains/.gradle/
jetbrains/.intellijPlatform/
mide-plugins/vscode/dist/
mide-plugins/vscode/out/
mide-plugins/vscode/*.vsix
mide-plugins/vscode/bin/
mide-plugins/clion/build/
mide-plugins/clion/.gradle/
mide-plugins/clion/.intellijPlatform/
mide-plugins/clion/.kotlin/
webui/dist/
*.log
compile_commands.json
dist-upload/
jetbrains/.kotlin/
.xlings/
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## 0.1.1

mcpp-vscode 1.0.1, mcpp-clion 0.1.1 and the first mcpp-nvim (0.1.1), with mcppls 0.0.19.

- **mcppls is found as the command that starts it.** mcppls 0.0.18 and later carry the server as an
okb that the platform's runner starts (`payload.json`'s `server`: `bin/okrun bin/mcppls.okb`). The
backend ran the okb itself for `--version`, so the VS Code extension's mcppls was reported as not
reporting its version (`permission denied`), and the payload in the user data directory was looked
for as `bin/mcppls`. A candidate is now a payload directory, whose `server` is started as it says,
or a program; `languageService/status` reports the `command` beside the `program`. What
`server` names is followed only inside the payload (a relative path with no `..` part), as mcppls
reads it.
- **VS Code**: the candidate is the mcppls extension's payload directory (`MCPPLS_PAYLOAD`, else
`<extension>/payload`), and `MCPPLS_SERVER`.
- **CLion**: the candidate is the payload the mcppls CLion plugin carries (mcppls 0.0.19 ships one
package per system, each with its server), with its runner made executable again when the
plugin's install dropped the bit, and `MCPPLS_SERVER`. *Install mcppls* and *Update
mcppls* open Settings | Plugins, where the Marketplace gives this system's package.
- **CLion 2026.1 and later** (since-build 261), as the mcppls plugin mcpp-clion depends on; the
Plugin Verifier checks 2026.1 and 2026.2.3, and the build loads this machine's mcppls 0.0.19
package.
- **The editor plugins are `mide-plugins/`**: `mide-plugins/vscode` (mcpp-vscode),
`mide-plugins/clion` (mcpp-clion; the protocol's editor id stays `jetbrains`, the IntelliJ
platform's) and `mide-plugins/nvim` (mcpp-nvim). The backend, the panels, `spec/`, `protocol/` and
the tests stay at the root; both earlier adapters build and test as before.
- **mcpp-nvim, mcpp's project features in Neovim 0.10 and later**, over the same backend through
Neovim's own JSON-RPC client: `:Mcpp <subcommand>` with completion, from the backend's command
table for the editor `nvim`; builds, tests, cleanups and packs as jobs streamed into
`mcpp://output`, cancelled with `:Mcpp cancel`; the program in a terminal buffer; debugging through
nvim-dap when it is present; targets, toolchains, new projects and libraries through
`vim.ui.select` and `vim.ui.input`; targets and platforms, the cache and the graphs as text in
floating windows; mcpp's diagnostics in the namespaces `mcpp` and `mcpp.toml`, and
`:Mcpp problems` in the quickfix list; `require('mcpp').status()` for the statusline. It registers
no language service: mcppls comes with mcppls-nvim (`xlings install mcppls-nvim`), which the plugin
names when mcppls is missing or older. The backend is `mcpp-ide` on PATH
(`xlings install mcpp-ide`) or setup()'s `backend`; `xlings install mcpp-ide-nvim` installs the
plugin with the backend and sets it up at Neovim's start (`vim.g.mcpp_auto_start = false` opts
out). A backend that ends is said; the requests and jobs waiting on it fail, and the next command
starts another, which watches the same projects. A headless suite runs it against the backend on
Neovim 0.10.4 and 0.12.5, over the mock mcpp and over the real one.
- **The protocol's editor `nvim`**, and each row of `commands/list` names its `subcommand` (the id
after `mcpp.`, or the row's own: `mcpp.cancelJob` is `cancel`). `spec/commands.json` says why an
editor is left out of a row (`omitted`); Neovim's table has `mcpp.problems` (the action `problems`)
and the quick menu, and leaves out the settings panel and the panels' entry pages. Which rows an
editor offers is one function, shared by the backend and `mcpp-ide-dev gen`.
- **The cache inventory's rows carry their size as text** (`bytesText`), for an editor that shows it
as text.

## 0.1.0

The first release of mcpp-ide: one backend for mcpp's editor integrations, the VS Code extension
Expand Down
53 changes: 30 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mcpp-ide - the IDE layer of mcpp

> One backend for every editor of [mcpp](https://github.com/mcpp-community/mcpp) projects: VS Code
> (mcpp-vscode) and CLion (mcpp-clion) build, run, test, debug and pack alike
> (mcpp-vscode), CLion (mcpp-clion) and Neovim (mcpp-nvim) build, run, test, debug and pack alike

**English** | [简体中文](README.zh-CN.md)

Expand All @@ -16,20 +16,22 @@ different tool.
mcpp-ide makes them once. Its backend, `mcpp-ide serve`, is a C++ program that reads only mcpp's
machine contract (event streams, result records, launch descriptors, JSON queries) and answers the
editors over JSON-RPC. The VS Code extension and the CLion plugin map those answers onto their own
UI and share one set of web panels. Language features of C++ files come from
[mcppls](https://github.com/Sunrisepeak/mcpp-language-server); mcpp-ide registers none.
UI and share one set of web panels; the Neovim plugin maps them onto buffers, floating windows and
the quickfix list. The editor plugins are `mide-plugins/` of this repository. Language features of
C++ files come from [mcppls](https://github.com/Sunrisepeak/mcpp-language-server); mcpp-ide
registers none.

## Features

| | VS Code (mcpp-vscode) | CLion (mcpp-clion) |
|---|---|---|
| Build, run, test | Tasks in a pseudoterminal showing mcpp's output | "mcpp" run configurations, PTY console, ▶ beside `main` |
| Test tree, re-run one test | Testing view | IDE test runner |
| Debug | CodeLLDB, C/C++ (gdb, lldb), lldb-dap | CLion's GDB or LLDB |
| Diagnostics | Problems, from mcpp's located diagnostics | Console links to the reported location |
| mcpp.toml | Problems from mcpp; completion, hover, outline from mcpp's key registry | Problems from mcpp |
| Targets and platforms, libraries, graphs, cache, pack, settings | Shared web panels | The same panels (JCEF) |
| Language features | mcppls (installed with the extension) | mcppls CLion plugin (a dependency) |
| | VS Code (mcpp-vscode) | CLion (mcpp-clion) | Neovim (mcpp-nvim) |
|---|---|---|---|
| Build, run, test | Tasks in a pseudoterminal showing mcpp's output | "mcpp" run configurations, PTY console, ▶ beside `main` | `:Mcpp build`, `test`: jobs streamed into a buffer; `:Mcpp run` in a terminal buffer |
| Test tree, re-run one test | Testing view | IDE test runner | `:Mcpp test <filter>` |
| Debug | CodeLLDB, C/C++ (gdb, lldb), lldb-dap | CLion's GDB or LLDB | nvim-dap (codelldb, lldb-dap, cppdbg, gdb) |
| Diagnostics | Problems, from mcpp's located diagnostics | Console links to the reported location | `vim.diagnostic`, `:Mcpp problems` in the quickfix list |
| mcpp.toml | Problems from mcpp; completion, hover, outline from mcpp's key registry | Problems from mcpp | Problems from mcpp |
| Targets and platforms, libraries, graphs, cache, pack, settings | Shared web panels | The same panels (JCEF) | Text in floating windows, `vim.ui.select`; settings in `setup()` |
| Language features | mcppls (installed with the extension) | mcppls CLion plugin (a dependency) | mcppls-nvim (`xlings install mcppls-nvim`) |

- **One answer everywhere** -- what a build runs, how a test is reported, what a cleanup costs: the backend's
- **Only mcpp's contract** -- no manifest parsing, no dependency resolution of its own
Expand All @@ -43,8 +45,8 @@ UI and share one set of web panels. Language features of C++ files come from

```
Read agents/README.md of https://github.com/mcpp-community/mcpp-ide, then install mcpp-ide for
the editor I use (VS Code or CLion) from its latest release, and check it with `mcpp-ide self-check`
on my mcpp project.
the editor I use (VS Code, CLion or Neovim) from its latest release, and check it with
`mcpp-ide self-check` on my mcpp project.
```

### From a release
Expand All @@ -53,21 +55,24 @@ on my mcpp project.
|---|---|---|
| VS Code | the Marketplace (`mcpp-community.mcpp-vscode`), or `mcpp-vscode-<version>.vsix` | search *mcpp*, or `code --install-extension mcpp-vscode-<version>.vsix` |
| VS Code-compatible editors | Open VSX, or the `.vsix` | install the `.vsix` from the extensions view |
| CLion 2025.2+ | JetBrains Marketplace (`mcpp-clion`), or `mcpp-clion-<version>.zip` | Settings → Plugins → Install Plugin from Disk; the mcppls CLion plugin first |
| CLion 2026.1+ | JetBrains Marketplace (`mcpp-clion`), or `mcpp-clion-<version>.zip` | Settings → Plugins → Install Plugin from Disk; the mcppls CLion plugin (its package for this system carries the server) first |
| Neovim 0.10+ | `mide-plugins/nvim` of the release's source tree | `xlings install mcpp-ide-nvim` (the backend with it, set up at start); or the directory on the runtimepath and `require('mcpp').setup()` ([its README](mide-plugins/nvim/README.md)) |
| Agents, other clients | `mcpp-ide-<version>-openkal.tar.gz` (both images; okrun for Linux x64/arm64, macOS arm64, Windows x64), `mcpp-ide-<version>.okb` with okrun, or `xlings install mcpp-ide` | run `bin/mcpp-ide serve` (`bin\mcpp-ide.cmd` on Windows), or `okrun mcpp-ide-<version>.okb serve` |

Each editor package serves every system: it carries the backend as one ok-image bundle
(`backend/mcpp-ide.okb`, the x86_64 and aarch64 images on openkal-platform 0.17.3) and okrun for
Linux x64/arm64, macOS arm64 and Windows x64.
Linux x64/arm64, macOS arm64 and Windows x64. The Neovim plugin carries none: it starts the
`mcpp-ide` command xlings installs (okrun on the same bundle).

### From source

```bash
mcpp build # the backend, the mock mcpp, mcpp-ide-dev
mcpp test # the backend's tests
cd vscode && npm ci && npm test # the extension's and the panels' tests
npm run package # dist/mcpp-vscode-<version>.vsix
cd ../jetbrains && gradle buildPlugin verifyPlugin # build/distributions/mcpp-clion-<version>.zip
mcpp build # the backend, the mock mcpp, mcpp-ide-dev
mcpp test # the backend's tests
cd mide-plugins/vscode && npm ci && npm test # the extension's and the panels' tests
npm run package # dist/mcpp-vscode-<version>.vsix
cd ../clion && gradle buildPlugin verifyPlugin # build/distributions/mcpp-clion-<version>.zip
cd ../.. && nvim --headless --clean -l mide-plugins/nvim/tests/smoke.lua # the Neovim plugin's tests
```

`xlings install gradle` brings Gradle and its JDK.
Expand All @@ -77,8 +82,10 @@ cd ../jetbrains && gradle buildPlugin verifyPlugin # build/distributions/mcpp-
- [docs/architecture.md](docs/architecture.md) -- the three layers and their boundaries
- [protocol/protocol.schema.json](protocol/protocol.schema.json) -- the backend's methods and notifications
- [protocol/mcpp-contract.schema.json](protocol/mcpp-contract.schema.json) -- the part of mcpp's contract it reads
- [spec/](spec) -- settings, commands, translations: the source of both editors' declarations
- [vscode/README.md](vscode/README.md), [jetbrains/README.md](jetbrains/README.md)
- [spec/](spec) -- settings, commands, translations: the source of the editors' declarations and command tables
- [mide-plugins/vscode/README.md](mide-plugins/vscode/README.md),
[mide-plugins/clion/README.md](mide-plugins/clion/README.md),
[mide-plugins/nvim/README.md](mide-plugins/nvim/README.md)

## Contributing

Expand Down
Loading
Loading