barreiroleo / ltex_extra.nvim

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

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

Closed iamcxds closed 8 months ago

iamcxds commented 8 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 8 months ago

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

iamcxds commented 8 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 8 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 8 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.