ltex_extra.nvim icon indicating copy to clipboard operation
ltex_extra.nvim copied to clipboard

disabledRules in ltex settings are ignored

Open HawkinsT opened this issue 1 year ago • 1 comments

Describe the bug With the following config:

require("lspconfig").ltex.setup {
    on_attach = function(client, bufnr)
        require("ltex_extra").setup {
            load_langs = { "en-GB" },
            init_check = true,
            path = "ltex",
            log_level = "none",
        }
    end,
    settings = {
        ltex = {
            language = "en-GB",
            disabledRules = {
                ["en-GB"] = { "PROFANITY", "IE_NO_COMMA", "EG_NO_COMMA", "PASSIVE_VOICE", "BACHELOR_ABBR" }
            },
            dictionary = {
                ["en-GB"] = { "Neovim", "ltex-ls" }
            },
            additionalRules = {
                enablePickyRules = true,
                motherTongue = "en-GB",
                languageModel = "~/ngrams"
            }
        }
    }
}

None of the disabledRules specifically passed to ltex ("PROFANITY", "IE_NO_COMMA", "EG_NO_COMMA", "PASSIVE_VOICE", "BACHELOR_ABBR") are listened to if ltex_extra is also attached. Creating an ltex.disabledRules.en-GB.txt file with these rules works, but if I want to use ltex for per-project rules (so my ltex_extra path is project-relative) I have to copy this file every time.

Expected behavior I believe ltex_extra should always follow any disabledRules passed to ltex specifically and ltex.disabledRules.*.txt files should always supplement instead of supersede this (or at least these rules shouldn't be ignored if such a file doesn't exist).

System:

  • OS: Linux (Arch)
  • Neovim version: [nightly]
  • LTeX server intallation method: [mason]

HawkinsT avatar Nov 11 '22 00:11 HawkinsT