didibus / anakondo

Minor mode for Clojure[Script] completion powered by clj-kondo.
MIT License
114 stars 1 forks source link

Company-capf error when writing namespaced functions in Clojure #2

Open jaidetree opened 4 years ago

jaidetree commented 4 years ago

Description :octocat:

company-capf error when working with namespaced functions in Clojure. Preventing me from accessing namespaced functions.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

Expected behaviour: :heart: :smile:

When did it start?: 🕚 A few days ago when I updated to latest spacemacs develop commit 1f6e39ea8ab3e7b7cb0a89889dec307523dfc6b and updated packages.

System Info :computer:

Backtrace :paw_prints:

Company: backend (company-capf :with company-yasnippet) error "JSON readtable error: 47" with args (candidates p/)
didibus commented 4 years ago

Thanks for reporting, I'll look into it.

Seems like there's an error when parsing the json analysis returned by clj-kondo.

I need to temporarily remove the "/" to avoid a clj-kondo parse error, but normally I add it back when it returns the analysis, I suspect I should have some error handling here in case the parse fails to at least put back the "/" in case something fails.

jaidetree commented 4 years ago

After more trial and error I found the case: I didn't install clj-kondo on my home computer. Once I did this problem stopped happening.

That said, maybe the error message could be improved if clj-kondo is not installed?

didibus commented 4 years ago

Ah, great news, I was having a hard time trying to reproduce this.

Ya, that's a good point. I should more gracefully handle clj-kondo being missing. I'll see what I can do about it. At the very least, the buffer should be restored and maybe I can find a way to improve the error message.