Zulip Chat Archive
Stream: Emacs
Topic: inlayHint
Yury G. Kudryashov (Mar 03 2025 at 21:46):
After an upgrade to 4.18.0-rc1, I'm getting this warning:
Warning (lsp-mode): Unknown request method: workspace/inlayHint/refresh
Did something change in the Lean lsp server implementation?
Patrick Massot (Mar 03 2025 at 21:49):
Yes, Marc worked a lot on inlay hints.
Patrick Massot (Mar 03 2025 at 21:50):
This mean some extra text displayed by the editor which is not in your source code.
Patrick Massot (Mar 03 2025 at 21:50):
https://github.com/leanprover/lean4/pull/7112
Patrick Massot (Mar 03 2025 at 21:51):
https://github.com/leanprover/lean4/pull/6768 has some screenshot
Patrick Massot (Mar 03 2025 at 21:52):
The very light gray stuff in
image.png
is not part of the file, it’s added by the editor.
Patrick Massot (Mar 03 2025 at 21:52):
those are auto-implicit types.
Yury G. Kudryashov (Mar 03 2025 at 21:53):
Thank you! I'll see if Emacs lsp supports them. For now, I'll just ignore the warning.
Yury G. Kudryashov (Mar 03 2025 at 21:54):
@Mekeor Melire Do you know anything about this?
Mauricio Collares (Mar 04 2025 at 13:57):
(setq lsp-inlay-hint-enable t)
(lsp-inlay-hints-mode)
Yury G. Kudryashov (Mar 04 2025 at 17:33):
I tried this, and I'm still getting the warnings.
Mauricio Collares (Mar 04 2025 at 21:19):
What's your lsp-mode package version? I can see the inlay hints here.
Yury G. Kudryashov (Mar 04 2025 at 21:52):
9.0.1
Mauricio Collares (Mar 06 2025 at 09:13):
Right, I see the same thing as well when opening Mathlib/Control/Random.lean. lsp-mode contains this line:
,@(when lsp-inlay-hint-enable '((inlayHint . ((refreshSupport . :json-false)))))
which indicates the server shouldn't be sending refresh requests in the first place (and inlay hints work without them). cc @Marc Huisinga
Marc Huisinga (Mar 06 2025 at 09:34):
Feel free to open a bug report about this in the Lean 4 repository. Note that without support for refresh requests, inlay hints cannot ever become a usable feature in any editor that lacks them.
Currently, we don't really implement any support for client capabilities at all; either the client supports the features that are provided by the Lean language server with its various extensions and LSP spec violations that are necessary for interactive theorem proving, or it will be broken in various ways and (at best) only function correctly in some cases by accident.
In general, my recommendation would be to switch to a plugin that is actually being maintained (like the NeoVim plugin) and hasn't been in a half-broken and unmaintained state for years. Alternatively, someone needs to step up to properly maintain the Emacs plugin and bring it into a mostly feature-complete and working state, after which I'll be happy to coordinate changes to the language server with the maintainer before a release, as we now do with NeoVim.
Mauricio Collares (Mar 06 2025 at 10:20):
Thanks for the information! I think it's fair to say no one will switch from Emacs to vim to get inlay hints, but I will file an issue in the lsp-mode repository now that I know that support for refresh requests is essential.
Mauricio Collares (Mar 06 2025 at 10:41):
Posted a comment on a preexisting issue (https://github.com/emacs-lsp/lsp-mode/issues/4230), but that was filed for the semgrep LSP. I will file a separate issue if I don't see activity after a few days.
David Renshaw (Mar 14 2025 at 15:29):
I opened an issue: lean4#7488
David Renshaw (Mar 14 2025 at 15:32):
in a half-broken and unmaintained state for years
lean4-mode had been working well for me, until this warning started showing up.
Berber (Mar 14 2025 at 15:56):
i'm kind of sad that emacs lean4-mode is in such a bad state. i am also just sad that working with lean is almost only possible with vs code and nvim. i am happy that there is at least one other editor than vs code.
Julian Berman (Mar 14 2025 at 16:03):
As just an interested outsider I think Marc made it sound like above that all that's really needed is some more ownership over pushing the emacs plugin forward, no? I think @Yury G. Kudryashov expressed similar sentiments before that he feels he's not quite an expert enough in emacs to own maintenance (apologies if I'm misremembering). It looks like there's 4 current open PRs, if it's helpful I'm happy to review some of them even myself if they're stuff I had to understand for the nvim plugin, though of course I'm not an emacs expert by any means, but it seems to me like a decent step is someone saying they want to own helping to review the open PRs and perhaps then that person or one or more people getting commit bit on the repo (or otherwise it living somewhere else if leanprover-community
is less comfortable with giving that out).
Julian Berman (Mar 14 2025 at 16:04):
(None of which is to say that if it worked fine before and it's easy enough to do so that just disabling this warning might be a good short term thing -- though I think it sounded like the LSP doesn't really respect client capabilities at all at the minute so who knows how easy that is. Well. Marc is a who :)
David Renshaw (Mar 14 2025 at 16:13):
The above discussion makes it sound like this particular issue (lack of support for inlay refresh) is with upstream lsp-mode, not with lean4-mode.
Berber (Mar 14 2025 at 16:18):
indeed, i also understand the problem as being with lsp-mode, not with lean4-mode.
however, the fact that the last commit has been 3 months ago, and that its development seems scattered (with good efforts that i support, like making it work with eglot), does not look good.
Kevin Buzzard (Mar 14 2025 at 16:26):
My impression is that the community would welcome people who would like to make the Lean-in-emacs experience better. Whilst the majority of people here use VS Code, several power users are using nvim and certainly there have been power users using emacs in the past (and the existence of this channel is another indication that people are interested). Lean is rapidly-changing software and my understanding of the above discussion is that it is only recently that things got derailed a bit with recent changes to core Lean.
Yury G. Kudryashov (Mar 14 2025 at 20:39):
Indeed, I don't have much time for Emacs lean4-mode. I'll do my best to go over the open PRs this weekend.
Yury G. Kudryashov (Mar 14 2025 at 20:41):
AFAIR, at least one of the open PRs is a large refactor. I plan to cherry-pick some parts of it to the current HEAD
, then decide what to do with non-bc changes.
Joseph Myers (Mar 15 2025 at 01:21):
I'm working around this warning with
(setq warning-minimum-level :error)
(though that potentially disables other warnings as well).
Yury G. Kudryashov (Mar 15 2025 at 02:42):
Pressing Enter adds this to custom-set-variables
:
'(warning-suppress-types '((lsp-mode)))
Notification Bot (Apr 24 2025 at 19:26):
6 messages were moved from this topic to #Emacs > Dev: Inlay Hint Refresh Request by Mekeor Melire.
Mekeor Melire (Apr 24 2025 at 19:29):
(Sorry for the noise, I had bad luck renaming this topic in Zulip. Further discussion will take place in Dev: Inlay Hint Refresh Request
topic.)
Last updated: May 02 2025 at 03:31 UTC