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

Good completion suggestions require extra type hints #113

Open
lassemaatta opened this issue Nov 11, 2023 · 2 comments
Open

Good completion suggestions require extra type hints #113

lassemaatta opened this issue Nov 11, 2023 · 2 comments

Comments

@lassemaatta
Copy link

I was writing some Java-interop code with cider and noticed that I need to add a lot of explicit type-hints to get good quality autocomplete suggestions. It was suggested to me in slack that I ought to open an issue.

My assumption was that code like

(doto (BaseClass.)
  (.| ))

would provide completion for methods of BaseClass. Instead, it looks like I get suggestions for hundreds of methods from some other clases. For example:

Screenshot 2023-11-11 084140

To get better suggestions, I need to say:

(doto ^SomeClass (SomeClass.)
  (.| ))
Screenshot 2023-11-11 084158

Also, I noticed that the completions do not consider the class inheritance hierarchy. Here, the ChildClass inherits from BaseClass:

Screenshot 2023-11-11 084820

An example repository.

Versions:

  • CIDER 1.12.0-snapshot
  • GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu)
@lassemaatta lassemaatta changed the title Good completion suggestions require extra many type hints Good completion suggestions require extra type hints Nov 11, 2023
@vemv
Copy link
Contributor

vemv commented Nov 11, 2023

Thanks!

I'd say that the gist of this issue is similar to #111 , except that for constructors instead of static method calls.

We currently fail to type-infer for the simplest constructor call:

image

...The good news is that the improvement is definitely at hand.

@alexander-yakushev
Copy link
Owner

Were able to fix the superclass issue.

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

3 participants