LSP-powered diagnostics for .proto files using the easyp linter.
Two parts in one repo:
easyp-lsp— a standalone LSP server written in Go (stdio). OndidOpen/didSaveit runseasyp lintfrom the project root and publishes diagnostics for every file in the project. Reusable from any LSP-capable editor.- Neovim plugin — registers the server for
filetype=protoand activates it only wheneasyp.yamlis found upward from the file.
-
Neovim >= 0.11
-
Go (one-time build of the server binary)
-
easypin$PATH:go install github.com/easyp-tech/easyp/cmd/easyp@latest
With lazy.nvim:
{
"devdammit/easyp.nvim",
ft = "proto",
build = "go build -o bin/easyp-lsp ./cmd/easyp-lsp",
}The plugin sets itself up with defaults. To customize:
require("easyp").setup({
cmd = { "/path/to/easyp-lsp" }, -- default: <plugin>/bin/easyp-lsp
easyp_bin = "easyp", -- or { "go", "tool", "easyp" } for a version pinned in go.mod
lint_root = nil, -- proto import root relative to the project root, passed as `easyp lint -r`;
-- nil = auto-detect from generate.inputs[].directory.root in easyp.yaml
severity = "warning", -- error | warning | info | hint
})The server can also be installed standalone (for use outside Neovim):
go install github.com/devdammit/easyp.nvim/cmd/easyp-lsp@latest- When a
.protobuffer opens, the plugin looks foreasyp.yamlupward from the file (vim.fs.root). No config file — the server never starts. - On every open/save the server runs
easyp lintin the project root (JSON output viaEASYP_FORMAT=json, with a fallback parser for the text format). If the project keeps protos under a separate import root (e.g.proto/withimport "common/model.proto"), the server picks it up fromgenerate.inputs[].directory.rootineasyp.yamland passes it aseasyp lint -r— setlint_rootexplicitly if your config declares no generate inputs. - Diagnostics are published for all files in the project: the rule name (
FIELD_LOWER_SNAKE_CASE, …) goes intocode, the source iseasyp. Issues that disappear after a fix are cleared.
easyp exit codes: 0 — clean, 1 — lint issues found (normal), 2 — import error (surfaced via window/showMessage).
make build # bin/easyp-lsp
make test # parser unit testsSample project for manual testing: testdata/sample (deliberately invalid api/bad.proto).
End-to-end check:
EASYP_E2E=1 nvim --headless --clean -u testdata/minimal_init.lua testdata/sample/api/bad.proto