Ltex-ls is a good alternative for grammar checking

I noticed that lsp-mode offers a client for ltex-ls which is basically an LSP server for using LanguageTools, a tool to perform grammatical check and more.

I was thinking: well, Doom already facilitates checking our grammar and style with :checkers grammar spell, grammar module already using langtool which brings LanguageTools into Emacs.

However, ltex-ls has support for 8 markup languages, which are: BibTEX, ConTEXt, LATEX, Markdown, Org, reStructuredText, R Sweave and XHTML. And this is not limited to markup languages, but also supports checking in comments for 39 different programming languages.

I’m unsure if this lsp server can be used in plain text files with no markup at all, but it may be the case given how versatile it is.

For people using eglot, there is a package that adds support for ltex-ls LSP server called eglot-ltex.

It would be great to add another flag for :checkers grammar and/or :checkers spell to use ltex-ls instead of aspell and langtool, or entirely change everything to just use ltex-ls underneath.

[dump]generated feb 27, 2023 16:13:01 system “EndeavourOS Linux” Linux 6.1.12-arch1-1 x86_64 x emacs 29.0.60 makepkg f72a39471 ~/.emacs.d/ doom 3.0.0-pre PROFILE=_@0 HEAD → master 788e507d 2023-02-22 00:46:47 -0500 ~/.doom.d/ shell /bin/zsh features ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB traits gui server-running envvar-file custom-file custom connection-local-profile-alist connection-local-criteria-alist warning-suppress-types safe-local-variable-values custom-safe-themes modules :config use-package :completion (company +childframe) (ivy +childframe +prescient +icons) :ui doom doom-dashboard doom-quit hl-todo hydra (ligatures +iosevka +extra) modeline ophints (popup +defaults) (treemacs +lsp) unicode vc-gutter vi-tilde-fringe window-select workspaces :editor (format +onsave) file-templates fold lispy multiple-cursors snippets :emacs dired electric undo vc :term vterm :checkers (syntax +childframe) (spell +aspell +everywhere) grammar :tools (debugger +lsp) docker editorconfig (eval +overlay) lookup (lsp +peek) (magit +forge) make pdf rgb taskrunner tree-sitter (&user shackra:lsp-tailwindcss) :lang data emacs-lisp (gdscript +lsp) (go +lsp +tree-sitter) (haskell +dante +lsp +tree-sitter) (json +tree-sitter) (javascript +lsp +tree-sitter) (kotlin +lsp) (latex +lsp) markdown (org +dragndrop +pretty +noter +pomodoro +present) plantuml (python +lsp +tree-sitter) rest (rust +lsp +tree-sitter) (scheme +guile) (sh +lsp) (web +lsp +tree-sitter) (yaml +lsp) (&user shackra:rego) (&user shackra:deno) (&user shackra:graphql) (&user shackra:pkgbuild) (&user shackra:nginx) :config literate (default +bindings +smartparens) packages (svelte-mode :recipe (:host github :repo leafOfTree/svelte-mode) :pin 25d0018036f44ff9bd685a1c9a76d8ba57c1024d) (code-compass :recipe (:host github :repo ag91/code-compass :files (.el scripts pages))) (ob-kotlin :recipe (:host github :repo shackra/ob-kotlin :files (.el))) [/dump]

2 Likes