Fork me on GitHub
#vim
<
2022-04-21
>
peterh11:04:52

After using clj-kondo with ALE for some time (integrated with vim-iced, which is amazing), I tried to use it directly with COC following the instructions in https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md#cocnvim . It works just fine, except auto refresh doesn’t really work anymore as it did with Ale. Refresh only happens after save, regardless of my settings in COC config. Is it just me or does anyone else experience this issue? Other linters work with COC and auto refresh. I’m fine going back to ALE, just wondered if I can let COC handle the linting instead.

dave13:04:05

I migrated from ALE to COC long ago. COC works great for me. The clj-kondo linting does automatically update as I edit the file, without needing to save.

peterh20:04:05

Sounds like the issue might be in my Neovim config then. I tried disabling all my other plugins, but it still doesn’t work. Did you use the exact configuration for COC (with the diagnostic extension) I linked above or something else?

dave20:04:08

No, I don't actually use clj-kondo directly. It comes bundled with clojure-lsp which I do use.

dave20:04:48

Here is my COC config, in case it's helpful: https://github.com/daveyarwood/dotfiles/blob/master/vim/nvim/coc-settings.json There is very little config for clojure-lsp

👍 1
peterh21:04:13

Thanks for sharing! I couldn’t find the issue yet, but maybe the integration works differently with clojure-lsp vs clj-kondo. I only started recently working in Clojure and never tried clojure-lsp, but I may give it a try. Would you recommend it over something like vim-iced, Cider, Cursive, etc.? I wonder if I can use it together with vim-iced or if they would interfere with each other.

dave21:04:44

clojure-lsp is in a different category from those other things. It's a language server, so any text editor with LSP client support (including Neovim with COC) can make use of its features, which include linting and code refactoring tools. Clojure-lsp is excellent, I definitely recommend it

peterh22:04:05

Sounds nice. I might just try it now, so at least I know if the problem is with clj-kondo or something else.

peterh00:04:47

Wow - not only did clojure-lsp resolve my auto refresh issue, it also integrates surprisingly well with CoC (your config helped me get started) and vim-iced and I can finally get some features like “jump to definition” or “open ClojureDocs” to work with vim-iced. Love it!

dave00:04:38

Awesome, I'm happy it's working out!