Erlang go-to-definition and hover docs#50
Merged
JesseHerrick merged 8 commits intomainfrom May 1, 2026
Merged
Conversation
Replace the per-.formatter.exs BEAM process model with a single persistent BEAM process that hosts multiple formatter children on demand via DynamicSupervisor + Registry. CodeIntel (Erlang go-to-def, hover docs) is a singleton — no more picking an arbitrary process for code intel queries. - Formatter GenServer starts lazily per .formatter.exs path, loads config and plugins independently, caches opts for subsequent requests - Walk findFormatterConfig up to projectRoot instead of mixRoot, fixing umbrella projects with a root-only .formatter.exs (#34) - Add bp.Ready() guard before Erlang go-to-def/hover to prevent stdout race between the ready signal reader and request readers - Collapse Server.formatters map + formattersMu into single beam/beamMu
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 58c2b4f. Configure here.
Reuse cached token streams for completion and common Elixir source queries, including token-aware completion contexts that skip strings and comments. Make the persistent BEAM formatter safer by synchronizing stderr capture and restarting when formatter config changes outside DidSave.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

#30
.formatter.exschanges outsideDidSave, and invalidating BEAM processes on formatter watcher events..formatter.exsup to the LSP project root, so child apps without their own formatter config use the umbrella root config. Closes use umbrella root formatter config when present #35 and Root .formatter.exs support for umbrella projects #34.Note
High Risk
High risk due to a large refactor of the persistent formatter into a multiplexed BEAM process plus new Erlang definition/hover/completion paths, touching core LSP request handling, process management, and caching/concurrency.
Overview
Adds a new persistent
beam_server.exsthat multiplexes formatting and CodeIntel over a framed binary protocol (requests/responses/notifications), including OTP module warmup, Erlang source/doc lookup, exports, and runtime fingerprinting.Replaces the old single-purpose persistent formatter (
formatter_server.exs) with a shared per-_buildBEAM process in Go, including request demux byrequest_id, notification handling, stderr tail capture for crash diagnostics, and restart/eviction on.formatter.exschanges (including umbrella-aware config lookup).Extends LSP features to support Erlang atom module references (
:code.all_loaded) for go-to-definition and hover, adds Erlang module/function completions backed by warmed OTP module/exports caches, and introduces token-awareCompletionContextAtCursorto avoid offering completions inside strings/comments and to better handle:vs::.Updates snippet insertion (pipe-aware argument indices) and adds snippet completions for Elixir special forms when the client supports snippets, with expanded test coverage for BEAM protocol behavior, formatter config reloads, and Erlang features.
Reviewed by Cursor Bugbot for commit 8d04fec. Bugbot is set up for automated code reviews on this repo. Configure here.