compliment
compliment copied to clipboard
Good completion suggestions require extra type hints
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:
To get better suggestions, I need to say:
(doto ^SomeClass (SomeClass.)
(.| ))
Also, I noticed that the completions do not consider the class inheritance hierarchy. Here, the ChildClass
inherits from BaseClass
:
An example repository.
Versions:
-
CIDER 1.12.0-snapshot
-
GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu)
Thanks!
I'd say that the gist of this issue is similar to https://github.com/alexander-yakushev/compliment/issues/111 , except that for constructors instead of static method calls.
We currently fail to type-infer for the simplest constructor call:
...The good news is that the improvement is definitely at hand.
Were able to fix the superclass issue.