Re: [GNU ELPA] New package: flymake-harper

Juri Linkov <[email protected]>
Newsgroups gmane.emacs.devel
Organization LINKOV.NET
Message-ID <[email protected]>
>>> How do I act on Harper diagnostics?
>>> I see it can flag typos and grammar errors, and the diagnostic message
>>> text includes possible replacements, but how do I actually apply one of
>>> those suggestions?
>>>
>>> [ This is related to a general missing feature in Flymake, which I've
>>>   requested in bug#71504: allowing backends to provide fixes for
>>>   diagnostics, which users can then apply/accept.  Without such support,
>>>   I'm not sure Flymake is the best fit for spell/grammar checking. ]
>>
>> I think Flymake should use UI similar to Flyspell for fixing errors.
>
> Do you mean `ispell-word' specifically?  Perhaps it would be enough for
> simple analysis that just replaces a phrase, but for Flymake in general
> it seems like we should be more flexible and allow for more than just
> text replacements.

Flyspell provides a context menu for suggested replacements.
Also 'C-;' (flyspell-auto-correct-previous-word) auto-corrects
the word using the first of suggested replacements.

I have no idea what Flymake could do for auto-corrections.
Using the provided replacements looks too restricted
to spell-checking.  'flymake-harper' uses the command
"harper-cli lint" to get a list of errors.  But it seems
there is no option for auto-correction.

'harper-ls' has a code action for quick fixes that
suggests fixes for the selected error.  But integration
with eglot is more uncertain.  Only someone with
a wide overview of capabilities of many LSP servers
can find a common denominator for all auto-correction
tools because server capabilities differ wildly.
For example, some use "textDocument/formatting"
with 'eglot-format' for auto-corrections,
some provide auto-corrections for the whole project,
or for a separate file, or for one error kind, etc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.