Files
zeekay 33e55f9dd7 rebrand: capnp-ls -> zap-ls (binary, project, default compiler, download)
Finish the ZAP rebrand of the language server, completing the prior
config-id rename (capnp-ls-client -> zap-ls-client) with the binary,
project, default schema-compiler command, and release/download wiring.

- CMake: project() and exe_name capnp-ls -> zap-ls. Build now emits
  build/zap-ls.
- compilation_manager.cpp: default compiler command "capnp" -> "zap";
  suffix guard now accepts endsWith("zap") || endsWith("capnp") (back-
  compat with a real capnp binary); version regex accepts "Zap version
  X.Y" (emitted by the cpp-core fork, VERSION_STRING="Zap version")
  as well as "Cap'n Proto version X.Y". Without the regex change the
  version check would reject the zap binary and block all compilation.
- extension.ts: binaryName, downloadCapnpLs -> downloadZapLs, fallback
  command + log strings, and download URL -> github.com/zap-proto/lsp
  asset zap-ls-linux-x86_64.
- ci.yml: rename/upload/download/release artifact capnp-ls-linux-x86_64
  -> zap-ls-linux-x86_64 and `mv build/zap-ls ...` so the artifact name
  matches the extension's download URL and the new CMake output. The
  ghcr.io/.../capnp-prebuilt-ubuntu libcapnp build image is preserved.
- package.json (x2), testFixture settings.json, README.md, samples/
  README.md: repo URLs -> zap-proto/lsp; default compiler "capnp" ->
  "zap"; binary path build/zap-ls; titles -> "ZAP Language Server".

Preserved (load-bearing libcapnp parser dependency): all #include
<capnp/...>/<kj/...>, capnp::/kj:: API calls, capnp_ls namespace,
find_package(CapnProto REQUIRED), CapnProto::capnp-rpc / capnp-json,
the USE_BUNDLED_CAPNP_TOOL ExternalProject block (capnproto.org 1.1.0,
BUNDLED_CAPNP_EXECUTABLE), the .capnp extension/alias/import refs, the
"capnp" initializationOptions key, and prose stating the server is
built on / wire-compatible with Cap'n Proto.

TODO (out of scope, flagged for follow-up): the `zap` binary is the
same brace-only cpp-core C++ fork; it does NOT yet parse the
whitespace-significant ZAP dialect. Switching the subprocess to `zap`
is necessary but not sufficient for whitespace .zap files. Full
whitespace symbol-resolution requires an INDENT/DEDENT lexer +
declaration-order ordinal inference in cpp-core/c++/src/zap/compiler
(lexer.c++ / parser.c++) emitting a correct CodeGeneratorRequest with
preserved SourceInfo byte offsets; the LSP's libcapnp usage
(symbol_resolver SchemaLoader::load on the binary graph) needs no
change once the binary parses the new syntax.

Build risk (CI): the C++ build (cmake + libcapnp 1.1.0) cannot be
verified here — no cmake/libcapnp in this environment. TypeScript
edits verified (downloadZapLs call/def match; isolated tsc parse clean
aside from pre-existing missing @types/node + vscode ambient types).
JSON files parse. Flag the C++ compile + the new release-asset name
for CI verification.
2026-06-19 14:53:59 -07:00

1.9 KiB

ZAP Language Support for VS Code

A VS Code extension that provides language support for ZAP schema files (built on Cap'n Proto).

Features

  • Go to definition
  • Diagnostics (error reporting)

Requirements

  • Cap'n Proto compiler(version 1.1.0 or higher): capnp
  • ZAP Language Server: zap-ls

Extension Settings

This extension contributes the following settings:

  • zap-ls-client.languageServer.path: Path to the ZAP language server executable. If not specified, the extension will first look for a zap-ls binary in the extension directory, then search in the system PATH. For Linux x86_64 systems, the binary will be automatically downloaded if not found in either location.
  • zap-ls-client.compiler.path: Path to the ZAP schema compiler executable. If not specified, it defaults to "zap" from the system PATH. When using a bundled version of zap-ls (built with -DUSE_BUNDLED_CAPNP_TOOL=ON), this setting is optional and the bundled compiler will be used automatically.
  • zap-ls-client.compiler.importPaths: Additional import paths for ZAP schemas.
  • zap-ls-client.server.extraEnv: Extra environment variables that will be passed to the zap-ls executable.
    • CPP_LOG: Log level for the Cap'n Proto language server.
      • Example: CPP_LOG=lsp_server=info: Set log level to info.
      • Default: CPP_LOG=lsp_server=warning

Example configuration:

To customize the client settings, edit the .vscode/settings.json file in your workspace as follows:

{
    "zap-ls-client.languageServer.path": "/absolute/path/to/zap-ls",
    "zap-ls-client.compiler.path": "zap",
    "zap-ls-client.compiler.importPaths": [
        "path/to/schema/imports"
    ],
    "zap-ls-client.server.extraEnv": {
        "CPP_LOG": "lsp_server=warning"
    }
}

See example configuration for more details.