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

Enable code mining for method references by default #1802

Open
vogella opened this issue Nov 20, 2024 · 5 comments
Open

Enable code mining for method references by default #1802

vogella opened this issue Nov 20, 2024 · 5 comments

Comments

@vogella
Copy link
Contributor

vogella commented Nov 20, 2024

Code minings in Eclipse are hard to discover for users, other IDEs enable (some) of them by default, hence making it obvious that they have it. In a recent workshop my clients were really surprised that the Eclipse IDE also has these.

I setting which I find useful and non-disruptive is the display of a method usage on top of methods.

image

Maybe we should enable this by default? This would signal to the user that we also support this.

cc @mickaelistria @jjohnstn

@jukzi
Copy link
Contributor

jukzi commented Nov 20, 2024

I had tried code mining once and disabled it because it behaved slow and looked more like an animation then a static text editor. Just tried it again with the setting suggested: while scrolling through a .java file it constantly moves lines around inserting the "x reference" Lines. I would only use it if it would not move lines around (possibly reserving the needed space ahead until number is available). It does not give enough value to justify the distraction.

@mickaelistria
Copy link
Contributor

For some cases, like error reports or parameter names, I do love code mining because they give me an information I almost always find useful while reading code. However I think that the "references" code mining is pretty useless to me in most cases; particularly if I already have a warning for unused variables/methods (the only case I care about is "0 reference" and is already reported as warning).
So if only one code mining were to be enabled by default, I would instead suggest the error markers and/or method parameter names.
However, the implementation of code minings can still sometimes slightly annoying as described by @jukzi (and several concrete issues against eclipse.platform.ui repo). Note that some of the concerns mentioned above might have been fixed in the meantime and stand not true any more so they should be verified and confirmed before making them a criterion of a decision. For example the scrolling strategy got improved a couple of years ago so the line that has caret shouldn't move usually.

@jukzi
Copy link
Contributor

jukzi commented Nov 20, 2024

Thanks for the suggestion @vogella. I would really like to see a seamlessly working parameter name! Unfortunately it is not yet seamlessly working for me though :-(

@vogella
Copy link
Contributor Author

vogella commented Nov 20, 2024

I find the parameter name code mining super annoying during development and super helpful during reading code. The method reference annotation is the only one I find always super helpful, as it allows me to navigate to the callers of the code and I see if a public method is not called in the workspace (can therefore can be deleted in most client implementations as they rarely define external API).

@HannesWell
Copy link
Contributor

AFAIK another issue with displaying the number of references is that it can require a lot of computational resources for public methods.

But if everything would work well it would be nice to have.

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

4 participants