fix(language-server): snippet completion for multi-word names and --version/--help #247

Merged
abiwab merged 2 commits from fix/lsp-completion-snippets into dev/1.6 2026-11-24 17:30:39 +01:00
Owner

Two fixes found while testing the language server in editors other than VS Code (step B of 1.6).

Snippet completion for multi-word names

  • Completing @wheat flour or &pizza dough inserts Name{$0} as a snippet when the client declares snippetSupport (ClientProfile.snippets, nameInsertion() in completions-ingredients.ts), so the cursor lands between the braces. Other clients keep the plain-text braces.
  • Patch changeset lsp-completion-snippets.md.

gram-language-server --version / --help

  • Before this, any unknown option started the server over stdio, which then waited silently on stdin.
  • New entry point src/main.ts answers --version/-v (the package version, injected at build time) or --help/-h, exits 0, and only loads ./server otherwise. The binary is still dist/server.cjs; gram lsp is unchanged (citty already answers both).
  • Tests in transport.test.ts, one sentence in reference/tooling/language-server.mdx (en + fr), first bullet of lsp-universal.md extended (the binary is unreleased).

Checks: bun test in language-server (249 pass), bun run typecheck, biome.

Two fixes found while testing the language server in editors other than VS Code (step B of 1.6). **Snippet completion for multi-word names** - Completing `@wheat flour` or `&pizza dough` inserts `Name{$0}` as a snippet when the client declares `snippetSupport` (`ClientProfile.snippets`, `nameInsertion()` in `completions-ingredients.ts`), so the cursor lands between the braces. Other clients keep the plain-text braces. - Patch changeset `lsp-completion-snippets.md`. **`gram-language-server --version` / `--help`** - Before this, any unknown option started the server over stdio, which then waited silently on stdin. - New entry point `src/main.ts` answers `--version`/`-v` (the package version, injected at build time) or `--help`/`-h`, exits 0, and only loads `./server` otherwise. The binary is still `dist/server.cjs`; `gram lsp` is unchanged (citty already answers both). - Tests in `transport.test.ts`, one sentence in `reference/tooling/language-server.mdx` (en + fr), first bullet of `lsp-universal.md` extended (the binary is unreleased). Checks: `bun test` in language-server (249 pass), `bun run typecheck`, biome.
abiwab merged commit 7478769470 into dev/1.6 2026-11-24 17:30:39 +01:00
abiwab deleted branch fix/lsp-completion-snippets 2026-11-24 17:30:39 +01:00
Sign in to join this conversation.
No description provided.