jhofscheier / ltex-utils.nvim

Implements code actions for the LTeX Language Server for neovim
MIT License
10 stars 7 forks source link

JSON file is not created when exiting Neovim. #2

Open bobby-welch opened 1 year ago

bobby-welch commented 1 year ago

When I open a new markdown file (e.g., test.md), I get the following message once the ltex server starts up: No existing settings file yet. Will be generated automatically when file closed. If I immediately exit the file, no JSON file is created. If I select the code action "Hide false positive" and then exit the file, no JSON file is created (so the same diagnostic will be visible when I open the file again). If I add a word to the dictionary, the JSON file is created and everything going forward works as expected ("hide false positive" requests are saved to the JSON file, etc.).

Installed via lazy.nvim:

return {
  "jhofscheier/ltex-utils.nvim",
  dependencies = {
    'neovim/nvim-lspconfig',
    'nvim-telescope/telescope.nvim',
    'nvim-telescope/telescope-fzf-native.nvim',
  },
  opts = {
    dictionary = {
      -- use vim internal dictionary to add unkown words
      use_vim_dict = true,
      -- show/suppress vim command output such as `spellgood` or `mkspell`
      vim_cmd_output = false,
    },
  },
}

In my on_attach function:

local on_attach = function(client, bufnr)
  ...
  ...
  if client.name == 'ltex' then
    require("ltex-utils").on_attach(bufnr)
  end
end
bobby-welch commented 1 year ago

Quick update: If use_vim_dict is set to false instead of true, the JSON files are created as expected.