Skip to content

feat(server): add persistent on-type indentation - #1986

Open
rgrinberg wants to merge 1 commit into
masterfrom
push-pquxlulnwpov
Open

feat(server): add persistent on-type indentation#1986
rgrinberg wants to merge 1 commit into
masterfrom
push-pquxlulnwpov

Conversation

@rgrinberg

Copy link
Copy Markdown
Member

Implement textDocument/onTypeFormatting for OCaml and ocamllex files using a separately packaged, optional ocp-indent-rpc helper.

The server resolves the helper lazily, negotiates a canonical S-expression protocol, and serializes requests through one persistent process. Newline-triggered requests update only the new line's leading whitespace; missing or failed helpers degrade to no edits. The helper caches resolved .ocp-indent configuration and is shut down with the server.

This also adds package metadata, Nix packaging, documentation, and end-to-end coverage for lazy startup and process reuse.

Implement textDocument/onTypeFormatting by lazily starting a persistent ocp-indent RPC helper and reusing it across newline requests. Package the helper, negotiate its Csexp protocol, support OCaml and ocamllex syntax, and shut it down with the server.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant