jdt-codemining
jdt-codemining copied to clipboard
New codemining: Show errors
Errors are marked with red squiggly lines and in the sidebar. However, I still have to hover with the mouse to actually read the issue. A codemining could show this inline, maybe with an upper limit ("only show errors if less than x errors in file").
Obviously, we could do the same for other markers. IMHO, this should definitely be configurable separately. Some codebases don't care about warnings, and there are cases where you can't get rid of some markers.
We need to try the renderer of the feature. I don't know if it's an hard thing to do.
+1
We need to try the renderer of the feature
Which renderer? What makes this suggested code mining different from other ones?
@enikao started to work on this today during EclipseCon Europe Unconference.
Here is the diff https://gist.github.com/mickaelistria/2aae7cc18cb52c1acb17c64cfbe62129
Here is how it looks like in the generic editor
Created Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=540443 Working on it at https://github.com/enikao/eclipse.platform.text/blob/Bug_540443/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ProblemMarkerCodeMiningProvider.java
Thanks @enikao !
I replaced the unicode symbols by icons (as proposed by @vogella):
Outstanding issues:
- I currently re-use the icons from org.eclipse.ui.internal.ide.IDEInternalWorkbenchImages. What's the right thing to do here? Ignore the warnings? Copy the icons?
- If there's more than one marker at one line, they appear at the same line (IMHO, that's a general code mining issue). However, the text of the first entry is cut off by the number of pixels I reserved for the icon.
- Do I need to translate the exception messages in e.g. https://github.com/enikao/eclipse.platform.text/blob/Bug_540443/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ProblemMarkerCodeMining.java#L93 ?
- How to handle monitor.isCancelled() in streams? This looks rather strange: https://github.com/enikao/eclipse.platform.text/blob/Bug_540443/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ProblemMarkerCodeMiningProvider.java#L84
@enikao your work is very cool, but it is not linked to JDT CodeMining. I suggets you that you post your question https://bugs.eclipse.org/bugs/show_bug.cgi?id=540443 and as @vogella suggested to provide a gerrit patch. Thanks!
Also you should use line minings instead of header minings, the error messages should be in the same line as the error marker
Angelo [email protected] schrieb am Fr., 26. Okt. 2018, 16:48:
@enikao https://github.com/enikao your work is very cool, but it is not linked to JDT CodeMining. I suggets you that you post your question https://bugs.eclipse.org/bugs/show_bug.cgi?id=540443 and as @vogella https://github.com/vogella suggested to provide a gerrit patch. Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angelozerr/jdt-codemining/issues/57#issuecomment-433433707, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIihoG1HRuYe_yTjsYF-9UXE7zjOlyCks5uoyC_gaJpZM4VCXPb .
Thanks for the hint @angelozerr, I'll continue the discussion there.
There is actually one aspect regarding JDT.
The Java editor also shows the minings, without any changes outside the generic editor:
In this screenshot, I just entered "asdfasdfads" + ENTER. Clearly, the result is not really what we expected (line 6 should not have a line number, misses the icons, and is wrongly indented. Also, it should be above line 8, not line 7. the "return void" error is there twice at wrong positions).
org.eclipse.jdt.ui version is 3.15.0.v20180829-2215