docs: set Eglot :language-id so ty works with python-base-mode#3532
Merged
Conversation
Closes astral-sh#2937. Eglot derives the LSP `languageId` from the major-mode symbol, so registering ty against `python-base-mode` causes Eglot to send `python-base`, which the ty server rejects. Adding `:language-id "python"` to the `eglot-server-programs` entry fixes the registration without giving up the single-entry coverage that `python-base-mode` provides for both `python-mode` and `python-ts-mode`.
0af76fa to
7680b4a
Compare
dhruvmanila
approved these changes
May 26, 2026
dhruvmanila
left a comment
Member
There was a problem hiding this comment.
Thank you! The explanation is useful but I think it's not really required in the setup documentation here, so I've removed it. Let me know if you think otherwise.
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.
Summary
:language-id "python"to the Egloteglot-server-programsentry in the Emacs editor-integration docs so the recommended snippet works out of the box.languageIdfrom the major-mode symbol, so the previouspython-base-modeentry caused Eglot to advertise documents aspython-base. The ty server only accepts thepythonlanguage id (text_document.rs), so users were silently getting no diagnostics.Test plan