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

cljr-add-stubs fails over :import-ed Java classes #479

Open
vemv opened this issue Feb 2, 2021 · 0 comments
Open

cljr-add-stubs fails over :import-ed Java classes #479

vemv opened this issue Feb 2, 2021 · 0 comments

Comments

@vemv
Copy link
Member

vemv commented Feb 2, 2021

Expected behavior

cljr-add-stubs will succesfully complete a reify for a Java class that has been :imported, i.e. the symbol is not package-qualified.

Actual behavior

Errors with Can't find interface IntConsumer

Steps to reproduce the problem

  • (:import java.util.function.IntConsumer)
  • type (reify IntConsumer) in a clojure buffer
  • Place POINT over IntConsumer
  • Invoke cljr-add-stubs normally (I use hydra)

clj-refactor.el version information

This repo @ master

Analysis

When there's no prefix (which is the case with :imported classes), the following LOC is executed:

(format "%s/%s" (cider-current-ns) interface)))

which appears to mistakenly fill IntConsumer with the equivalent of (ns-name *ns*) instead of the actual java package.

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

No branches or pull requests

2 participants