Subject: bug#67870: 29.1; Eglot missing or un-findable advertised feature

From: João Távora <[email-masked]>
Date: Mon, 18 Dec 2023 17:00:27 +0000

On Sun, Dec 17, 2023 at 7:40 PM Dave Abrahams <[email-masked]> wrote:

> The info page for Eglot says:
>
> 3.1 Eglot features:
>
>    • On-the-fly diagnostic annotations with server-suggested fixes, via
>      the Flymake package (*note (flymake)Top::).
>
> But I can find no evidence of the support for server-suggested fixes
> either in flymake or in eglot itself.  I am working with an LSP server
> that offers fix-its but can't find any way to apply them.

Isn't very hard to find in "3.3 Eglot commands" IMO

‘M-x eglot-code-actions’
‘M-x eglot-code-action-organize-imports’
‘M-x eglot-code-action-quickfix’
‘M-x eglot-code-action-extract’
‘M-x eglot-code-action-inline’
‘M-x eglot-code-action-rewrite’
     These commands allow you to invoke the so-called “code actions”:
     requests for the language server to provide editing commands for
     correcting, refactoring or beautifying your code.  These commands
     may affect more than one visited file belonging to the project.

     The command ‘eglot-code-actions’ asks the server if there [are] any code
     actions for any point in the buffer or contained in the active
     region.  If there are, you have the choice to execute one of them
     via the minibuffer.

     A common use of code actions is fixing the Flymake error
     diagnostics issued by Eglot (*note (flymake)Top::).  Clicking on a
     diagnostic with ‘mouse-2’ invokes ‘eglot-code-actions-at-mouse’
     which pops up a menu of available code actions.  The variable
     ‘eglot-diagnostics-map’ can be used to control the mouse binding.

     Other commands execute a specific code action.  For example,
     ‘eglot-code-action-organize-imports’ rearranges the program's
     “imports”--declarations of modules whose capabilities the program
     uses.

> Either what's meant by this should be clarified, leading to discoverable
> instructions for exploiting the feature, or the text should be removed.

That's just a summarized list of the main features, a detailed description
doesn't of how to use the feature doesn't belong there.  But patches welcome for
a link down to 3.3 (and fixing the typo while you're at it).

João