Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabledRules in ltex settings are ignored #18

Open
HawkinsT opened this issue Nov 11, 2022 · 1 comment
Open

disabledRules in ltex settings are ignored #18

HawkinsT opened this issue Nov 11, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@HawkinsT
Copy link

HawkinsT commented Nov 11, 2022

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]
@barreiroleo barreiroleo added the enhancement New feature or request label Nov 11, 2022
@barreiroleo
Copy link
Owner

Yeah, that makes sense. I didn't think about it before, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants