barreiroleo / ltex_extra.nvim

Provides external LTeX file handling (off-spec lsp) and other functions.
GNU General Public License v3.0
148 stars 16 forks source link

Initial check and reload() don't work #53

Closed iamcxds closed 9 months ago

iamcxds commented 9 months ago

Describe the bug The initial check and reload() doesn't work properly. It can't load my dictionary. The log has only [ltex_extra] [TRACE 16:10:07] ~/.local/share/nvim/lazy/ltex-extra.nvim/lua/lt ex_extra/commands-lsp.lua:79: updateConfigFull then nothing happens, no error or further step.

But it works properly if I make a code action of adding new words.

To Reproduce Steps to reproduce the behavior:

  1. Your settings for ltex are:
    lspconfig.ltex.setup {
    capabilities = capabilities,
    on_attach = function(client, bufnr)
    on_attach(client, bufnr) -- rest of your on_attach process.
    require("ltex_extra").setup {
      load_lang={"en-US",},
      init_check = true,
      path =  "~/.local/share/ltex",
      log_level="trace",
    }
    end,
    }

System:

Additional context I used Nvchad to setup .

barreiroleo commented 9 months ago

Can you try setting the path as path = vim.fn.expand("~/.local/share/ltex")?

iamcxds commented 9 months ago

Can you try setting the path as path = vim.fn.expand("~/.local/share/ltex")?

This doesn't fix. And the problem exists with the default path setting.

iamcxds commented 9 months ago

It seems like some problem with getting access to the options, If I manually run reload() it stops very quickly, but reload({"en-US") works, from the code the problem seems to come from load package.loaded.ltex_extra.opts.load_langs

barreiroleo commented 9 months ago

I was able to reproduce it and you have a typo in the settings. It's load_langs not load_lang. In the other hand, I need to rewrite this thing.

michael-pfister commented 1 week ago

Not sure as to why this bug was closed on an open source project. I am experiencing the same problem. Even if OC rewrote the entire plugin, someone could see this issue and make a PR for the old one.

@iamcxds did you find a solution for this? I also noticed that it'll start working again if we reload multiple languages :lua require('ltex_extra').reload({'en-US', 'de-DE'}).

I tried doing this automatically after the plugin was initialized but it didn't seem to work.

barreiroleo commented 1 week ago

I closed this bug because, as I mention in my last reply, there was a typo in the config. Please, open a new bug saying what branch are you using and post your plugin setup.

michael-pfister commented 1 week ago

right, I opened #62