Skip to content

docs: expand Emacs setup with Eglot and lsp-mode configs#2972

Merged
davydkov merged 2 commits into
likec4:mainfrom
farhan523:docs/emacs-lsp-setup
May 22, 2026
Merged

docs: expand Emacs setup with Eglot and lsp-mode configs#2972
davydkov merged 2 commits into
likec4:mainfrom
farhan523:docs/emacs-lsp-setup

Conversation

@farhan523

Copy link
Copy Markdown
Collaborator

Checklist

  • I've thoroughly read the latest contribution guidelines.
  • I've rebased my branch onto main before creating this PR.
  • I've added tests to cover my changes (if applicable). (docs-only, no tests)
  • I've verified pnpm typecheck and pnpm test. (no source changes; docs unaffected by either)
  • I've added changesets.
  • My change requires documentation updates.
  • I've updated the documentation accordingly.

Summary

Resolves #2268.

The existing Emacs section in apps/docs/.../editors.mdx is a one-line eglot-server-programs stub plus a "see #2268 for discussion" link. This PR replaces it with a complete walkthrough so new Emacs users can copy-paste a working setup.

The content is based on @vincent067's post in #2268@davydkov asked for it to be added to the docs there. Adapted from his original to use the standalone likec4-lsp binary from @likec4/lsp, which is what the rest of this page recommends (instead of likec4 lsp from the main CLI).

What's added

  • A likec4-mode major-mode definition deriving from prog-mode, wired to .c4 / .likec4 via auto-mode-alist.
  • Eglot config (built-in since Emacs 29).
  • lsp-mode config.
  • Credit to @vincent067 with a link to the issue thread.

Test plan

  • Visually inspected the rendered section — code blocks, headings, internal links (#standalone-language-server, #neovim) all resolve.
  • Confirmed likec4-lsp --stdio command matches the binary documented in the page's "Standalone Language Server" section.

Replaces the minimal `eglot-server-programs` stub in editors.mdx
with a complete walkthrough covering Eglot, lsp-mode, and a
`likec4-mode` major mode definition for `.c4` / `.likec4` files.

Based on the working setup posted by @vincent067 in likec4#2268,
adapted to use the standalone `likec4-lsp` binary from
`@likec4/lsp` (consistent with the rest of the page).

Resolves likec4#2268
@changeset-bot

changeset-bot Bot commented May 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b913de0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@likec4/docs-astro Patch
likec4 Patch
likec4-vscode Patch
@likec4/playground Patch
@likec4/style-preset Patch
@likec4/styles Patch
@likec4/config Patch
@likec4/core Patch
@likec4/diagram Patch
@likec4/generators Patch
@likec4/language-server Patch
@likec4/language-services Patch
@likec4/layouts Patch
@likec4/leanix-bridge Patch
@likec4/spa Patch
@likec4/log Patch
@likec4/lsp Patch
@likec4/mcp Patch
@likec4/react Patch
@likec4/tsconfig Patch
@likec4/vite-plugin Patch
@likec4/vscode-preview Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73863632-53a5-4c53-8f21-e679ca67a4c4

📥 Commits

Reviewing files that changed from the base of the PR and between ebfb6ce and b913de0.

📒 Files selected for processing (1)
  • apps/docs/src/content/docs/tooling/editors.mdx

📝 Walkthrough

Walkthrough

This PR expands Emacs editor support documentation for LikeC4. A new changeset records a patch to @likec4/docs-astro and the docs now show a likec4-mode definition plus configuration examples for both Eglot and lsp-mode wiring to the standalone @likec4/lsp server.

Changes

Emacs LSP Setup Documentation

Layer / File(s) Summary
Changeset metadata
.changeset/docs-emacs-lsp-setup.md
Records a patch to @likec4/docs-astro documenting expanded Emacs LSP setup and referencing issue #2268.
Emacs LSP setup documentation
apps/docs/src/content/docs/tooling/editors.mdx
Replaces brief Emacs guidance with full setup instructions: defines likec4-mode for .c4/.likec4 files, provides Eglot registration and hook, provides lsp-mode language/client registration with lsp-stdio-connection, and updates closing sentence with feature parity note and attribution link.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: expanding Emacs documentation with Eglot and lsp-mode configuration examples.
Description check ✅ Passed The description comprehensively covers all checklist items, explains the rationale, details what was added, provides attribution, and documents the test plan.
Linked Issues check ✅ Passed The PR addresses #2268 by providing native Emacs support with configuration examples for both Eglot and lsp-mode, fulfilling the primary objective.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing #2268: expanding Emacs documentation with LSP setup guidance and adding a changeset file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/src/content/docs/tooling/editors.mdx`:
- Line 96: The text says "minor wrapper mode" but the snippet uses
define-derived-mode ... prog-mode (i.e., a major mode); change the wording to
"major wrapper mode" or otherwise indicate it's a major mode derived from
prog-mode to match the code (referencing the define-derived-mode ... prog-mode
declaration).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b48d741a-10ff-458f-9ff8-a30d7839a64d

📥 Commits

Reviewing files that changed from the base of the PR and between 590864d and ebfb6ce.

📒 Files selected for processing (2)
  • .changeset/docs-emacs-lsp-setup.md
  • apps/docs/src/content/docs/tooling/editors.mdx

Comment thread apps/docs/src/content/docs/tooling/editors.mdx Outdated
Snippet defines likec4-mode via define-derived-mode ... prog-mode,
which is a major mode. Updates the prose to match.

Addresses CodeRabbit review feedback on likec4#2972.

@davydkov davydkov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farhan523 Thanks a lot!!

@davydkov davydkov enabled auto-merge (squash) May 22, 2026 12:58
@davydkov davydkov merged commit 278d112 into likec4:main May 22, 2026
14 checks passed
@likec4-ci likec4-ci Bot mentioned this pull request May 22, 2026
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.

[feature request]: add emacs support

2 participants