-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
WIP: Add constructor info to arglists of Java classes #87
Conversation
Java argnames seem to be an odd situation, they're not always present and sometimes go missing after the cache is cleared (a JVM optimization maybe?) Arguably the type of the args is more important as that is what distinguishes constructors from each other. But currently eg. (Integer/sum | )
;; => eldoc displays "java.lang.Integer/.sum ([a b])" with no indication of the types. With the constructors I tried to display both argname and argtype by making a symbol with a space separating the two, such that eldoc will highlight it as one item. In any case the behaviour should be made consistent between constructor and member info. |
I have some vague memory that we were actually displaying only types at some point. I don't recall when this changed, but there's clearly some room for improvement. @jeffvalk Any thoughts on this? |
@@ -3,6 +3,10 @@ | |||
in editors." | |||
{:author "Bozhidar Batsov"}) | |||
|
|||
(def ^:private type-abbrevs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go this route this should be something optional (and ideally something that clients can modify).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree - it should probably be a client-side processing step, eg. eldoc could do a search-and-replace via regex.
Btw, which cache are you referring to here? |
I was referring to |
@yuhan0 I totally forgot about this PR. Are you still interested in driving it to completion? |
Let us know, else it sounds practical to close the PR to avoid accumulating distractions in our trackers |
Yes, sorry for dropping this one somewhat, I had hacked on it during a short period while doing some icky Java interop. , and now it seems that I've largely forgotten about the issues that I was facing at the time. It looks like I wanted feedback regarding the following points:
static void foo (int a, double b) {....}
static void foo (double c, int d) {...} Should we represent these as |
I think it's time to close this one. No point in just keeping it around. |
Yes, with #211 (which I still plan to tackle), the end solution would look definitely different. |
This is partly an issue report and partly showing the current state of my edits for discussion.
Not suitable for merging as-is.
This change allows for java class constructors to provide the :arglists key in the info op response. No other change in cider-nrepl or cider.el is needed, it can be previewed by overriding the below
type-info
function in the cider-nrepl inlined namepsace.At first I added a separate :ctors key but this required many changes to client code, I think using the :arglists key is alright for this purpose.
Before submitting a PR make sure the following things have been done:
Keep in mind that new orchard builds are automatically deployed to Clojars
once a PR is merged, but only if the CI build is green.
Thanks!