Summary: | Support Multiline Code Mining | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Max Leuthäuser <max.leuthaeuser> | ||||
Component: | Text | Assignee: | Platform-Text-Inbox <platform-text-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | dorian.blaj, eclipse, gautier.desaintmartinlacaze, sebastian.zarnekow | ||||
Version: | 4.11 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
*** Bug 546995 has been marked as a duplicate of this bug. *** we would also be interested in this feature. We actually tries to implement some in-house solution, which works rather well on default resolution scaling (100%), however it has issues when the resolution scaling is non-default. |
Created attachment 277676 [details] Rendered code mining with line breaks. Overview: Currently, code mining only supports text without line breaks. This is due to the fact that `org.eclipse.jface.text.codemining.AbstractCodeMining.draw` only calls `org.eclipse.swt.graphics.GC.drawString` and `org.eclipse.swt.graphics.GC.stringExtent`. They do not execute any tab expansion or carriage return processing as documented. To Reproduce: Simply override `org.eclipse.jface.text.codemining.AbstractCodeMining.draw` and call `org.eclipse.swt.graphics.GC.drawText` and `org.eclipse.swt.graphics.GC.textExtent` instead (they do carriage return processing). Now, line breaks are rendered correctly. On the downside, the following text in the editor will overlap because `org.eclipse.jface.text.source.inlined.LineHeaderAnnotation.getHeight` only calculates the text height with `org.eclipse.swt.custom.StyledText.getLineHeight` not taking line breaks into account (see the attached image). Expected Results: `org.eclipse.jface.text.source.inlined.LineHeaderAnnotation.getHeight` takes newlines (if present) into account. Note: The same applies to `org.eclipse.jface.text.source.inlined.LineContentAnnotation`.