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

Use code mining to allow user to update the classpath via the Gradle editor #712

Open
vogella opened this issue Jul 3, 2018 · 10 comments
Open

Comments

@vogella
Copy link
Contributor

vogella commented Jul 3, 2018

If a user edits the build.gradle file he can update the classpath via right-mouse click. It would be nice if this can be done inline. For example, for the target editor I'm working to allow its activation via the text editor and code mining.

activate

The related code changes can be found here: https://git.eclipse.org/r/#/c/125149/

It is relatively simple to provide this (see Gerrit) and I think Gradle users would benefit from this.

@oehme
Copy link
Member

oehme commented Jul 3, 2018

What does inline mean? What is "code mining" in this context? I can't really tell from the screenshot. Maybe a screencast would help?

@vogella
Copy link
Contributor Author

vogella commented Jul 3, 2018

Ah, sorry, I assume everyone knows about the Eclipse 4.8 code mining API.

Code mining is called code lenses in VSCode and allow to enhance the source code with additional information. In the above screenshot Set as Active Target Platform is not part of the source file, it is added as additional information and action which (should) allow to active the target platform.

Other, more complex examples are code mining for JDT, see https://github.com/angelozerr/jdt-codemining which contain a lot of animated gifs. The Gerrit from above should give you a hint how to implement this, if desired.

@oehme
Copy link
Member

oehme commented Jul 3, 2018

Got it, thanks! That looks useful indeed. Would be a great community contribution.

@vogella
Copy link
Contributor Author

vogella commented Sep 21, 2018

@oehme I could contribute the code mining without the specific Gradle logic. Would that be helpful? I guess it will be easy for you to add the buildship specific logic and it (should be) easy for me to add the code mining header annotation.

@vogella
Copy link
Contributor Author

vogella commented Oct 17, 2018

@donat WDYT?

@donat
Copy link
Contributor

donat commented Oct 17, 2018

Makes sense to me.

Regarding the specification, you would add this code mining features for all .gradle and .gradle.kts files, right? Can we display the UI contribution only for files located in Gradle projects?

The Buildship-specific part is really simple; you can call ProjectSynchronizer.execute() to start the synchronization from the UI. Nonetheless, if you provide the skeleton, I can add it there. The build script needs adjustments anyway: as the related code needs to be compiled only for Eclipse 4.8+, whereas currently, we compile all sources for Eclipse Kepler and above.

@vogella
Copy link
Contributor Author

vogella commented Oct 25, 2018 via email

@donat
Copy link
Contributor

donat commented Oct 29, 2018

FFR I pushed the prototype to the donat/code-mining/prototype branch.

@vogella
Copy link
Contributor Author

vogella commented Jan 14, 2019 via email

@donat
Copy link
Contributor

donat commented Jan 18, 2019

@vogella I've cleaned up the prototype code and created a new PR from it. There are a couple of things which need to be sorted out before we can merge this:

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

3 participants