davidmh / cspell.nvim

A companion plugin for null-ls/none-ls, adding support for CSpell diagnostics and code actions.
82 stars 13 forks source link

Stopped Working. #41

Closed ovidius72 closed 9 months ago

ovidius72 commented 9 months ago

I used to have this config working fine until a few days ago (maybe 1/2 weeks)

local cspell_config = {
  diagnostics_postprocess = function(diagnostic)
    diagnostic.severity = vim.diagnostic.severity['HINT'] -- ERROR, WARN, INFO, HINT
  end,
  config = {
    find_json = function(_)
      return vim.fn.expand '~/.config/ksvim/cspell.json'
    end,
  },
}

and none-ls (config function of lazy):

local none_ls = require('null_ls')
local cspell = require('cspell')
none_ls.setup {
    border = 'rounded',
    sources = {
       -- DIAGNOSTIC
       none_ls.builtins.diagnostics.yamllint.with {
           diagnostics_format = '[yamllint] [#{c}] #{m}',
       },

       cspell.diagnostics.with(cspell_config),

       -- CODE ACTIONS
       none_ls.builtins.code_actions.eslint_d,
          cspell.code_actions.with(cspell_config),
      },
 }

Unfortunatly it doesn't work anymore. No diagnostic and no code actions are available.

NullLSLog return an empy buffer.

What is the correct way to make it working with the latest changes ? thanks.

ghost commented 9 months ago

Same here.

davidmh commented 9 months ago

What version of CSpell are you using, and how are you making it available to nvim?

ovidius72 commented 9 months ago

What version of CSpell are you using, and how are you making it available to nvim?

As you can see from my first message, that is the setup of none_ls, which worked fine so far. cspell diagnostic and code_action are configured with that custom config. I have my cspell json inside a directory called ksvim in the user config folder. This is the exact same configuration that used to work until the last week I guess.

cspell version is 8.1.3, installed through Mason.

davidmh commented 9 months ago

I'm having issues reproducing the problem, it's specially hard when there are no error messages.

Could you try reproducing the issue using this minimal config?

https://github.com/davidmh/cspell-nvim-minimal-init/

ovidius72 commented 9 months ago

I'm having issues reproducing the problem, it's specially hard when there are no error messages.

Could you try reproducing the issue using this minimal config?

https://github.com/davidmh/cspell-nvim-minimal-init/

HI @davidmh . Thank you for you time. I guess I found the problem and it is not related to this plugins. The problem for me was in the cspell.json file. I had an import entry like this:

  "import": [
     "@cspell/dict-it-it",                                                                                                  
     "@cspell/dict-en-common-misspellings",                                                                                     
     "@cspell/dict-en_us"                                                                                                      
  ],        

this was needed to read globally installed dictionaries. Removing the import entry works fine as before for me. I don't know if this can be replaced in another way but for the moment i've removed the import entry.

Thank you for you support and sorry for the noise.

If you want we can close the issue.

davidmh commented 9 months ago

No worries, that's great news!

@Sunnova-ahmedrezk could you try the minimal config as well? If you still have issues after that, I can reopen this issue.