Closed trev-dev closed 2 years ago
Thanks, this seems like a good valid issue with all that's needed. But I've exhausted my Eglot budget for the day (and maybe for the week :grimacing: ).
Can you double check that the eldoc-documentation-strategy
is actually being set to the eldoc-documentation-compose
? Maybe it's not. You can try to set it in eglot-managed-mode-hook
instead of your setq-local
, which -- I think -- would be overwritten by Eglot's management of that extension.
@trev-dev, I've only read the minimal configuration section of the bug report. (It is not minimal because the following lines can surely be omitted.)
(add-to-list 'eglot-server-programs '(php-mode . ("intelephense" "--stdio")))
It seems you are using a php lsp server. So can you take a look at #537, and contribute to it?
(define-key eglot-mode-map (kbd "C-c r") 'eglot-rename) (define-key eglot-mode-map (kbd "C-c r") 'xref-find-definitions))
The lines above bind to the same key.
@trev-dev, I've only read the minimal configuration section of the bug report. (It is not minimal because the following lines can surely be omitted.)
Apologies for that. I do not see how js-mode and php-mode could be getting confused in this context, but if need be, I can re-test without additional server configs and re-submit.
@trev-dev, I've only read the minimal configuration section of the bug report. (It is not minimal because the following lines can surely be omitted.)
(add-to-list 'eglot-server-programs '(php-mode . ("intelephense" "--stdio")))
It seems you are using a php lsp server. So can you take a look at #537, and contribute to it?
(define-key eglot-mode-map (kbd "C-c r") 'eglot-rename) (define-key eglot-mode-map (kbd "C-c r") 'xref-find-definitions))
The lines above bind to the same key.
This just shows how often I use these keybinds (rarely, if ever). Thanks for the catch! I would like to contribute to 537, but if I'm being honest, I don't use PHP frequently enough to call my feedback on LSP servers credible.
Can you double check that the
eldoc-documentation-strategy
is actually being set to theeldoc-documentation-compose
? Maybe it's not. You can try to set it ineglot-managed-mode-hook
instead of yoursetq-local
, which -- I think -- would be overwritten by Eglot's management of that extension.
There was definitely some ambiguity as to what was going on here when I had looked at described-variable. I tried binding it several ways and this is what I ended up with in the original, minimal config:
eldoc-documentation-strategy is a variable defined in ‘eldoc.el’.
Its value is ‘eldoc-documentation-enthusiast’
Original value was
‘eldoc-documentation-default’
Local in buffer test.js; global value is
eldoc-documentation-default
Hold up, that's not ambiguous at all. Let me try this again.
Ok, yep. I must have gotten my eyes crossed here. I thought the buffer-local value was compose. I must've read it incorrectly.
To the satisfaction of @nemethf and myself I also further minimized the config to this:
(load-file "~/.emacs.d/elpa/eglot-20220315.1021/eglot.el")
;; Set-up programming modes to use Eglot
(add-hook 'js-mode-hook #'eglot-ensure)
(add-hook 'eglot-managed-mode-hook
#'(lambda ()
(setq-local eldoc-documentation-strategy
#'eldoc-documentation-compose)))
And voila, eldoc is giving me all of my feedback now:
Thanks for talking this out with me. I will re-work my config to use the managed-mode hook instead of sequential function calls.
The issue
I've seen other issues here regarding Eldoc showing doclets/types in favor of error diagnostics from Flymake. It seems to me that the common solution is to set Eldoc's documentation strategy to compose. This is not working for me.
Before I eat up too much of anyone else's time: yes, I am using a git build of Emacs. I can, and will, go to the trouble of swapping back to stable if that is required. This may just be an Eldoc issue. Ultimately my goal is to rule out Eglot and decide what to do from there.
At the very end of this issue there are additional files/configurations to help re-produce this issue.
Refs to issues I looked into before submitting:
Visual examples of what is going on:
Given the following intentional errors:
Eldoc's output is only:
Flymake's error buffer:
The issue template
LSP transcript - M-x eglot-events-buffer (mandatory unless Emacs inoperable)
Backtrace (mandatory, unless no error message seen or heard):
No errors.
Minimal configuration (mandatory)
Note how this is different from the instructions, but still good.
Example JS file
Required jsconfig.json
You will need this if you expect TypeScript to check types in JavaScript. Put this in your project root as
jsconfig.json