Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jaidetree opened this issue May 2, 2020 · 3 comments
Open

Comments

@jaidetree
Copy link

Description :octocat:

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

Reproduction guide 🪲

  • Use the latest develop branch
  • Start Emacs
  • Create or edit a clojure file
  • Add a require like [clojure.core :as cc] to the namespace
  • Try typing "(cc/map)"

Observed behaviour: 👀 💔

  • When typing "(cc/" spacemacs will change it to "(cc" and show a company-capf readtable JSON error below the status bar
  • See screenshot of error
    Spacemacs Error Screenshot

Expected behaviour: ❤️ 😄

  • I am not prevented from typing "(cc/map)"
  • If a REPL is connected via Cider or Anakondo is running I see a list of completions after typing "(cc/"

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

System Info 💻

  • OS: OS X Darwin 10.15.3
  • Emacs: 26.3
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 1f6e39ea8)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(react lua sql html yaml python
       (auto-completion :variables auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t auto-completion-enable-sort-by-usage t)
       (clojure :variables clojure-enable-sayid t clojure-enable-clj-refactor nil clojure-enable-linters 'clj-kondo)
       anakondo emacs-lisp
       (git :variables git-magit-status-fullscreen t git-enable-github-support t git-gutter-use-fringe t)
       helm
       (javascript :variables js2-basic-offset 2 js-indent-level 2 js-expr-indent-offset -4)
       multiple-cursors markdown org osx
       (shell :variables shell-default-height 30 shell-default-position 'bottom)
       spell-checking syntax-checking
       (version-control :variables version-control-diff-tool 'diff-hl version-control-global-margin t)
       fennel spacehammer tabbar
       (spacemacs-layouts :variables spacemacs-layouts-restrict-spc-tab t))
  • System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS

Backtrace 🐾

Company: backend (company-capf :with company-yasnippet) error "JSON readtable error: 47" with args (candidates p/)
@didibus
Copy link
Owner

didibus commented May 2, 2020

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
Copy link
Author

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
Copy link
Owner

didibus commented May 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants