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

João Távora <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
>> Philip Kaludercic <[email protected]> writes:

>> [ 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. ]
> 
>If any progress were to be made on that bug, I think it would totally
>make sense to support this.

Should be reasonably straightforward to do in flymake-harper.  Proceed
exactly like eglot.el does.  AFAIR it is a strict user of Flymake's
interfaces.

- make Flymake error category symbols for harper diagnostics
- when making diagnostics, add the correction meta-info (I presume it is
  available) in the flymake-make-diagnostic call
- use flymake-overlay-control on those category symbols.  Add a keymap,
- make a new flymake-harper command and put it on the map.  The command
  uses meta-info and does the correction
- the map is activated when you click the flymake overlay

If you want to autocorrect a number of diagnostics, make a command that
uses flymake-diagnostics to get all diags in a region and iterate.

Alternatively, possibly just using harper-ls and/or multiplexing with
any other language server you are using is also a decent idea that
doesn't require a separate Flymake backend.

João
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.