doomemacs icon indicating copy to clipboard operation
doomemacs copied to clipboard

feat(grammar): add `+lsp` flag to enable `lsp-ltex`

Open abougouffa opened this issue 1 year ago • 6 comments

Enable fast grammar checking using lsp-ltex, which provides integration with the LTeX LS, this last uses LanguageTool to correct grammar. This is way faster and responsive than the currently used langtool package.

In addition, LTeX LS understands many formats and languages (like Org, Markdown, LaTeX...), so it produces less false positives related to the language keywords, tags, or commands.

The configuration can be used enabling +lsp for the grammar module.

Example Org document after enabling :checkers (grammar +lsp)

Screenshot_20220816_153750


abougouffa avatar Aug 16 '22 13:08 abougouffa

Is there a way to make this work when composing an email with mu4e?

numkem avatar Aug 24 '22 00:08 numkem

Is there a way to make this work when composing an email with mu4e?

@numkem In general, LSP servers try to load an entire workspace, which doesn't works with mails. I didn't dig deeper to figure out a workaround.

You can use flycheck-languagetool as an alternative, you can take a look at my config, you will find a configuration example there.

abougouffa avatar Aug 24 '22 01:08 abougouffa

Hi!

I just discovered the eglot counterpart for lsp-ltex called eglot-lsp (https://github.com/emacs-languagetool/eglot-ltex).

What do you think?

Is it worth include it in this PR or it could be in a future one?

Thanks.

maikol-solis avatar Oct 03 '22 11:10 maikol-solis

When using ltex-ls with eglot, you don't actually need the mentioned 3rd party package. You can just call:

(set-eglot-client! 'text-mode '("ltex-ls"))

peterhoeg avatar Apr 13 '23 04:04 peterhoeg

Anybody know how to make it work in programming mode?

npajkovsky avatar Feb 02 '24 16:02 npajkovsky

Disclaimer: I may be sharing outdated information here!

While there is nothing wrong with using it in prog-mode, I don’t think neither lsp-mode nor eglot support using multiple servers per file. And you would most likely want a server for the language you are editing rather than one for just the text bits.

peterhoeg avatar Feb 04 '24 22:02 peterhoeg