Last week, Eclipse Photon has been released, a new version of the Eclipse IDE and platform. It contains many useful improvements, so it is worth to update.
One of many noteworthy extensions is the new support for code mining. In case you wonder what that is (you do not even find a definition on wikipedia), let us quickly introduce this new feature. The general idea is to add additional information to a source code editor, which is not code or a comment. That means, this information is not stored in the underlying file, but it augments the text editor during runtime. In fact, you cannot only add information, but also actions, essentially buttons, that can trigger context related behavior.
Let us look at an example: In the following screenshot, you see a test case, which is augmented via code mining. For every test, it shows the state of the last test run, as well as two “buttons” (run and debug) to trigger another execution of the test. The same is available for the test class (e.g. “run all”). The screenshot also shows another example for code mining. The parameter passed into the Junit method fail() is augmented by the type and the name, as defined in the signature of fail().
Please note, that Eclipse itself does not provide any use cases of code mining, but it provides the ability to plugin code mining applications. The examples shown above are from the JDT Code Mining plugin, which can be found on Github. It allows to turn specific code mining applications on or off, depending on how useful you consider them.
Code Mining is a very interesting new feature an we look forward to new ideas and use cases that developers might add. Given the well-proven extension mechanism of Eclipse, it is relatively low effort to implement custom code mining extensions.
Further general improvements of the Eclipse Photon release are summarized in the following video, Java and Maven improvements in a separate video below. Both are provided by Holger Voormann, whom we want to thank you for this great work!
As always, in case you use our EclipseSource Oomph profile (see here for more details), you should get a notification and Oomph will apply the update automatically. If you do not get the notification, just navigate to the menu entry “Help” => “Perform Set-Up Task”. This will automatically update all plugins to Photon, but keep all existing settings untouched.
Have fun with Eclipse Photon!