Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

ltex fails to update configuration #209

Closed
00sapo opened this issue Oct 29, 2021 · 3 comments · Fixed by #218
Closed

ltex fails to update configuration #209

00sapo opened this issue Oct 29, 2021 · 3 comments · Fixed by #218
Labels
bug Something isn't working

Comments

@00sapo
Copy link

00sapo commented Oct 29, 2021

When trying to add false positives or disable a rule in ltex, it returns the error:
E5108: Error executing lua ...taller/lua/nvim-lsp-installer/servers/ltex/configure.lua:14: attempt to index local 'f' (a nil value)

I'm using LunarVim, but I don't think it affects the configuration, I'm using require'lvim.lsp.manager'.setup("ltex", {}), that should just load the default config from lspconfig

@williamboman
Copy link
Owner

Hey that code was actually copied from the lspconfig PR (neovim/nvim-lspconfig#863), I took a look again and it seems like it's since been removed. Will update the ltex entry in this plugin to reflect upstream changes

@williamboman williamboman added the bug Something isn't working label Oct 29, 2021
@abalmos
Copy link

abalmos commented Oct 29, 2021

It was removed in preparation of new code, but it appears to never have been finished. It was inteded to go into https://github.com/brymer-meneses/grammar-guard.nvim (brymer-meneses/grammar-guard.nvim#4) and @mjlbach indicated that is the best path forward: neovim/nvim-lspconfig#863 (comment) and brymer-meneses/grammar-guard.nvim#5 (comment)

@lbiaggi was working on backing porting the local command handlers to the new 5.1 API. This handles things like marking false positives, etc. (the code that was removed from the lspconfig PR). He may have run out of time to work on it (and maybe is using the coc plugin).

The code in this repo works with a small change

diff --git a/lua/nvim-lsp-installer/servers/ltex/configure.lua b/lua/nvim-lsp-installer/servers/ltex/configure.lua
@@ -126,9 +126,9 @@ configs.ltex = {
         root_dir = function(filename)
             return util.path.dirname(filename)
         end,
-        dictionary_files = { ["en"] = { vim.fn.getcwd() .. "dictionary.ltex" } },
-        disabledrules_files = { ["en"] = { vim.fn.getcwd() .. "disable.ltex" } },
-        falsepositive_files = { ["en"] = { vim.fn.getcwd() .. "false.ltex" } },
+        dictionary_files = { ["en"] = { vim.fn.getcwd() .. "/dictionary.ltex" } },
+        disabledrules_files = { ["en"] = { vim.fn.getcwd() .. "/disable.ltex" } },
+        falsepositive_files = { ["en"] = { vim.fn.getcwd() .. "/false.ltex" } },
         settings = {
             ltex = {
                 enabled = { "latex", "tex", "bib", "markdown" },

However, there seems to be some bugs around ltex actually respecting the files contents.

In short, I think you can remove the handlers from this repo (go to what the lsp-config PR is now). That makes ltex work but does not handle it's local commands. Folks should use grammar-guard.nvim (after it is extended) to get the local commands.

@williamboman
Copy link
Owner

Thanks for the context @abalmos! Updated the server config to follow upstream changes. Once the lspconfig PR is merged we can remove the overrides and only provide cmd in this plugin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants