Test and Debug
Run Tests
clice has three types of tests: unit tests, integration tests, and smoke tests.
All test dependencies (pytest, pygls, etc.) are managed by pixi — no separate installation needed.
Unit Tests
pixi run unit-test # default RelWithDebInfo
pixi run unit-test Debug # debug buildEquivalent to:
./build/RelWithDebInfo/bin/unit_tests \
--test-dir="./tests/data" \
--snapshot-dir="./tests/snapshots" \
--corpus-dir="./tests/corpus" \
--verboseIntegration Tests
End-to-end tests that start a real clice server and communicate via LSP protocol.
pixi run integration-test # default RelWithDebInfo
pixi run integration-test Debug # debug buildEquivalent to:
pytest -s --log-cli-level=INFO --timeout=300 --timeout-method=thread \
tests/integration --executable=./build/RelWithDebInfo/bin/cliceSmoke Tests
Replay recorded LSP sessions to catch regressions in protocol handling.
pixi run smoke-test # default RelWithDebInfo
pixi run smoke-test Debug # debug buildEquivalent to:
python tests/replay.py tests/smoke/*.jsonl \
--clice=./build/RelWithDebInfo/bin/cliceRun All Tests
pixi run test # runs unit + integration + smoke
pixi run test Debug # all tests with debug buildEditor E2E Tests
Smoke tests that run real editors (headless Neovim and VSCode) against a locally built clice binary, covering startup, first diagnostics, hover, definition and completion on two fixtures (including a C++20 modules project). CI runs them in the test-editor job on Linux with the latest stable editor releases, on purpose unpinned: the job exists to catch breakage caused by new editor versions.
$ pixi run build # build/RelWithDebInfo/bin/clice
$ pixi run -e editor editor-test # nvim + vscode, both fixturesPrerequisites outside the pixi env:
nvim(stable) onPATHfornvim-e2e.- A system
cmake/ninja/clangforeditor-prepareto configure the CMake-based module fixture (same assumption the integration tests make). - A display (or
xvfb-run) plus the usual Electron system libraries forvscode-e2e.
Debug
If you want to attach a debugger to clice, start it in socket mode independently, then connect a client.
./build/Debug/bin/clice server --mode socket --port 50051After the server starts, you can connect a client in two ways:
Connect via pytest
Run a single integration test against the running instance:
pytest -s --log-cli-level=INFO \
tests/integration/lifecycle/test_file_operation.py::test_did_open \
--mode=socket --port=50051Connect via VS Code
Configure the clice extension to connect to your running instance:
Install the clice extension.
Configure
.vscode/settings.json:jsonc{ "clice.executable": "/path/to/your/clice/executable", "clice.mode": "socket", "clice.port": 50051, // Optional: disable clangd if also installed "clangd.path": "", }Reload Window (
Developer: Reload Window) for settings to take effect.
Debug the VS Code extension
The extension lives in-tree at editors/vscode/:
Install dependencies:
shellcd editors/vscode pnpm installOpen the repository root in VS Code (the launch configurations are in
.vscode/launch.jsonat the root).Create
.vscode/settings.jsonwith the socket config above.Press
F5and selectVSCode Extension (pipe)orVSCode Extension (socket)to launch an Extension Development Host window.