tower-lsp: primary LSP transport/server framework. It already re-exports thelsp_typessurface we need, so we avoid a separate directlsp-typesdependency unless version pinning becomes necessary.tokio: async runtime for stdio LSP serving, background indexing, cancellation, and future task coordination.serde+serde_json: config, protocol-adjacent JSON handling, fixtures, and test payloads.tracing+tracing-subscriber: structured logs for editor/LSP debugging with env-configurable filtering.clap: small, standard CLI layer for binary flags like explicit stdio mode and future debug/config commands.ropey: efficient text storage plus line/offset mapping for LSP ranges, edits, and diagnostics.parking_lot: chosen overdashmapfor near-term shared state because current architecture needs predictable locks around document/workspace state more than a concurrent map API. Revisitdashmaponly if profiling shows real contention on keyed state.thiserror: typed internal errors for library boundaries and subsystem-specific failures.anyhow: ergonomic top-level/application error aggregation at binary and task boundaries.insta: snapshot coverage for diagnostics, formatting, and protocol payloads.pretty_assertions: readable structural diffs in unit/integration tests.tempfile: isolated workspace/file-fixture tests without polluting the repo.proptest: parser/formatter invariants and edge-case generation where example-based tests are too narrow.similar: text diff support for formatter and snapshot-adjacent assertions when we want explicit diff output beyond plain equality checks.
lymaremains optional and feature-gated because v1 stays parse-only by default, with upstream integration behind the local syntax facade.mietteremains in the crate for rich human-facing diagnostics/CLI error presentation even though it was not part of the narrower preferred set.- We intentionally do not add a direct
dashmapdependency yet;parking_lotcovers the current root-bounded workspace/document-state plan with less API commitment.
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test
cargo test --all-features
cargo test --test lsp_harness
cargo bench --bench parse_index
cargo doc --workspace --all-features --no-deps
cargo deny check
Use UPDATE_GOLDENS=1 cargo test --test parser_tests only when intentionally refreshing parser golden fixtures.
The VS Code extension lives under editors/vscode and launches the repository's local lymals binary over stdio.
From the repo root:
cargo build
From editors/vscode:
npm install
npm run compile
Use npm run watch instead of repeated npm run compile during active extension work.
- Open
editors/vscodein VS Code. - Set
lymalsExtension.server.pathto the local debug binary:- Windows:
../../target/debug/lymals.exe - macOS/Linux:
../../target/debug/lymals - If the binary lives under a path with spaces, enter the raw path value without extra quoting because the extension spawns it directly with command + argv (for example
C:\Program Files\Lymals\lymals.exeor/opt/my apps/lymals).
- Windows:
- Press
F5to start the Extension Development Host. - In the new window, open a sample
.lymafile such as../../tests/fixtures/diagnostics/syntax_error.lyma. - Confirm Lyma diagnostics appear in Problems.
- Open Output > Lymals to inspect extension logs, startup messages, and optional protocol trace output.
lymalsExtension.server.logFileadds--log-fileto the server command.- Example log-file paths:
- Windows:
C:\Users\you\AppData\Local\Lymals\logs\server.log - macOS/Linux:
/tmp/lymals/server.log
- Windows:
lymalsExtension.server.rustLogsetsRUST_LOGfor the spawned server process.- In Extension Development mode, leaving
lymalsExtension.server.logFileempty uses a storage-backed default log file; the resolved path is announced in Output > Lymals. lymalsExtension.server.trace.serveris the quickest way to inspect raw LSP traffic.
The root Taskfile.yml also contains a vsix helper for local packaging experiments, but that .vsix remains a development-only artifact and must not be described or treated as publishable in v1.
Package the extension locally from editors/vscode:
npm run package
That workflow is intentionally limited to producing a local .vsix build artifact. It does not publish, upload, or release anything to the VS Code Marketplace, Open VSX, or GitHub Releases.
Before considering a .vsix shareable even for internal review, inspect the exact contents:
npm run package:contents
Equivalent direct command:
vsce ls --tree --no-dependencies
Review that listing and confirm it excludes tests, node_modules, Rust target output, logs, and any secrets or local-only files.
Packaging notes:
- Default recommendation: do not bundle platform-specific
lymalsbinaries in the first VS Code packaging PR. - Preferred development flow: point the extension at a user-configured binary path or a
lymalsbinary already available onPATH. - If a future binary-bundling strategy is approved, run
cargo build --releasefirst and make any binary copy/embed step explicit, documented, and reviewable. - Keep
editors/vscode/package.json's extension version aligned with the Rust crate version inCargo.toml.
Marketplace/Open VSX prerequisites are intentionally out of scope here. Publisher ownership, versioning policy, licensing review, and release-artifact validation must be completed separately and approved by a maintainer before any future manual publish decision.
- Keep changes aligned with the v1 contract: release only raw
lymalsbinaries/checksums, keep editor integration docs-only, and do not add Lua execution paths to shipped features. - Run the validation commands above before opening a PR; at minimum, formatting, clippy, tests, docs, and
cargo deny checkshould pass locally or in CI. - Update user/developer docs when behavior, flags, configuration, safety limits, or packaging scope changes.
- Add or update focused tests with code changes; use snapshot/golden updates only when the behavior change is intentional.
- Document externally visible changes in
CHANGELOG.mdunderUnreleased.
tower-lspowns protocol dispatch insrc/server.rs; feature-specific request logic lives undersrc/handlers/.- Feature engines consume local parser/tokenizer/syntax/semantic facades rather than raw upstream AST types.
- Source-line or indentation heuristics are allowed only as supplements after syntax lookup (for example folding/selection/code-action edit extents), and should stay covered by focused tests.
src/imports.rsandsrc/workspace.rsenforce resolver containment and workspace limits.src/eval.rsis a fail-closed placeholder; do not call it from shipped editor features for v1.