Fill in the lsp-mode section (and fix a typo) - #2
Open
lagenorhynque wants to merge 2 commits into
Open
Conversation
Add a working lsp-mode setup to the previously empty lsp-mode section, mirroring the existing eglot one: flix-mode setup, LSP client registration, semantic tokens, the working-directory advice for the server's relative-path project scan, and a project-find-functions entry so plain Emacs recognizes flix.toml as a project root.
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.
This fills in the previously empty lsp-mode section of the README with a
working, verified configuration, mirroring the existing eglot one. It covers
the flix-mode setup, registering the Flix LSP client, semantic tokens, and the
working-directory advice needed so the server's project scan resolves
correctly.
The config is derived from my Spacemacs layer, reduced to a plain-Emacs
use-packagesetup, and verified on a clean Emacs 30 + Java 21 environment(LSP starts, cross-file module resolution works, and semantic highlighting,
hover, and the Run code lens all function).
Also fixes a small typo:
Use-package->use-packagein the eglot example.One thing worth discussing: the example registers
flix.tomlwithproject-find-functionsso that plain Emacs recognizes the project root.flix-mode resolves the compiler jar via
project.el(project-current), andwithout this registration
project-currentreturns nil and jar resolutionfails. This likely affects the eglot setup too, since it goes through the same
flix-mode-server-path. It might make sense for flix-mode itself to registerflix.tomlwithproject-find-functionsat load time, so neither exampleneeds it -- happy to do that in a follow-up if you agree, @mdiin.
There's also room to go further later (e.g. wiring the "Run" code lens to a
REPL, as the Spacemacs layer does), but this keeps the example on par with the
eglot one for now.