Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357516 - Marker tooltip / message is not displayed on left editor ruler when using custom markers
Summary: Marker tooltip / message is not displayed on left editor ruler when using cus...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 12:22 EDT by Kristian Nagy CLA
Modified: 2017-09-19 17:48 EDT (History)
3 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristian Nagy CLA 2011-09-13 12:22:31 EDT
Build Identifier: I20110613-1736

Move mouse over a resource marker displayed on left Xtext editor ruler. Marker message should be shown. This worked in Xtext 2.0.0. In Xtext 2.0.1 nothing is displayed when you move mouse over the marker. Xtext 2.0.1 displays the message only on right editor ruler.

Reproducible: Always

Steps to Reproduce:
1. Create custom marker extension in plugin.xml. Example:
    <extension
         id="com.examples.problem"
         name="Example problem marker"
         point="org.eclipse.core.resources.markers">
      <super
            type="org.eclipse.core.resources.problemmarker">
      </super>
      <super
            type="org.eclipse.core.resources.textmarker">
      </super>
   </extension>
2. Create a marker of this type:
IMarker m = iresource.createMarker("com.examples.problem");
		m.setAttribute(IMarker.LOCATION, "path to iresource (/Project/src/resource)");
		m.setAttribute(IMarker.MESSAGE, "Hello?");
		m.setAttribute(IMarker.LINE_NUMBER, 1);
3. Run the code above and in runtime Eclipse: move mouse over marker and see that no message appears on left editor ruler. There will be a message if you hover over the right editor ruler (only).
Comment 1 Holger Schill CLA 2011-09-19 08:42:46 EDT
After having a deeper look there was a guard in
org.eclipse.xtext.ui.editor.hover.AbstractProblemHover.isHandled(Annotation)
that filtered out non Xtext markers. I can not see a reason why this is a must. 

pushed test and fix to master.
Comment 2 Holger Schill CLA 2011-09-19 11:02:18 EDT
After a discussion with Sebastian the guard has to filter out so that only warnings and errors can be hovered. I will work on this issue again.
Comment 3 Holger Schill CLA 2011-09-19 11:42:36 EDT
Now the guard only enables hover for subTypes of org.eclipse.ui.workbench.texteditor.error and org.eclipse.ui.workbench.texteditor.warning.

Kristian,

for your example you have to set the severity to IMarker.SEVERITY_WARNING or IMarker.SEVERITY_ERROR to enable hover on your custom markers.

m.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);

pushed final fix to master :-)
Comment 4 Sebastian Zarnekow CLA 2011-09-19 12:06:30 EDT
Sorry Holger, I'm afraid I was wrong.

Please double check whether a bookmark (add via Add Bookmark... in the left gutter) is correctly displayed in the hover, too. I assume your initial patch was better than my suggestion.
Comment 5 Holger Schill CLA 2011-09-19 14:45:05 EDT
No problem. I replaced the implementation with the original one and bookmarks are not visible as hover also. Now I enabled subTypes of org.eclipse.ui.workbench.texteditor.bookmark also and everything is fine. I think I will add some tests for that stuff tomorrow. :-)

pushed to master.
Comment 6 Karsten Thoms CLA 2017-09-19 17:37:41 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 7 Karsten Thoms CLA 2017-09-19 17:48:44 EDT
Closing all bugs that were set to RESOLVED before Neon.0