Code Coverage Language Server
This project implements a Code Coverage Language Server that reads LCOV coverage reports and exposes the results through the Language Server Protocol.
Coverage information is surfaced using the
textDocument/documentColor
request, allowing editors to visually highlight covered and uncovered lines.
Zed-editor extension
Installation
The extension may be installed from source, by cloning fargies/coverage-lsp repository and selecting the zed-coverage-lsp directory from "Install Dev Extension" menu.
If not already found in path, the extension will download and install latest coverage-lsp server from GitHub's project releases.
To install your own version of coverage-lsp, simply use:
Configuration
The server can be configured through the following settings.
hit
CSS color used to highlight covered lines.
- Accepts any valid CSS Color Level 4 value.
- Set to
nullto disable highlighting for covered lines. - Parsed using
csscolorparser. - Default:
rgba(0%,100%,0%,10%)
miss
CSS color used to highlight uncovered lines.
- Accepts any valid CSS Color Level 4 value.
- Set to
nullto disable highlighting for uncovered lines. - Parsed using
csscolorparser. - Default:
rgba(100%,0%,0%,10%)
interval
Interval used to check whether the coverage file has changed.
- Parsed using
humantime-serde. - Example values:
3s,20s,1m - Default:
3s
lcov_file
Path to the LCOV coverage file to load.
- If not specified, the server searches the workspace and uses the first
*.infofile it finds.
Example Configuration
Development
# remove downloaded releases
# Clone and build this project
&&
# Add `coverage-lsp` to your path
# Start `zeditor`
# From the "Install Dev Extension" menu select `zed-coverage-lsp` directory
# Don't forget to "Rebuild" the extension and/or "Restart" the language-server to
# reflect changes