Skip to content

Adding an error threshold #8

@rememberYou

Description

@rememberYou

First of all, thank you for the initiative to publish lsp-ltex that I have just discovered.

I take the initiative to open this issue because I tested lsp-ltex with a text-mode hook (which includes org-mode) and I noticed that lsp-ltex (or LanguageTool) cannot deal well when a file got a too many (~2653) of errors as shown below.

2021-09-10-121859

At each "edit" (can also be for each save) of the file, lsp-ltex contacts LanguageTool with all the content of this file, which takes time and heats up my CPU. To avoid this issue, maybe it would be nice to propose to the user a variable to limit the use of LanguageTool for a file that contains a number of errors reaching a certain threshold. In other words, if lsp-ltex would encounters a file that exceeds a certain number of errors, then it should does nothing or disables itself.

If you wondering, this is the config of lsp-ltex that I use.

(use-package lsp-ltex
  :hook (text-mode . lsp-deferred)
  :custom
  (lsp-ltex-enabled t)
  (lsp-ltex-mother-tongue "fr"))

It is also possible that I can work around this problem by creating my own function that I hook and blacklist some files manually. However, probably an abstract solution to the user would be better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions