Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 527071 - [generic editor] Hover in .project editor does not work when .project example is present
Summary: [generic editor] Hover in .project editor does not work when .project example...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.8 M4   Edit
Assignee: Lucas Bullen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-09 11:12 EST by Dani Megert CLA
Modified: 2018-01-22 13:11 EST (History)
3 users (show)

See Also:


Attachments
warning hover in I20171115-2000 (43.51 KB, image/png)
2017-11-16 14:15 EST, Lucas Bullen CLA
no flags Details
hover in editor (20.02 KB, image/png)
2017-11-17 11:06 EST, Lucas Bullen CLA
no flags Details
removed margins (15.90 KB, image/png)
2017-11-23 10:24 EST, Lucas Bullen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2017-11-09 11:12:28 EST
Problem hover in .project editor does not work.

To test you need to fetch https://git.eclipse.org/r/#/c/111082/

Then launch a test workspace and add an invalid nature to .project. You should get a warning. Hovering over that warning does nothing.
Comment 1 Lucas Bullen CLA 2017-11-16 14:15:57 EST
Created attachment 271507 [details]
warning hover in I20171115-2000

Attached is the hover in I20171115-2000, is this not the expected hover result?
Comment 2 Dani Megert CLA 2017-11-17 10:28:03 EST
(In reply to Lucas Bullen from comment #1)
> Created attachment 271507 [details]
> warning hover in I20171115-2000
> 
> Attached is the hover in I20171115-2000, is this not the expected hover
> result?

I assume this is the one when hovering over the ruler icon. I'm talking about the hover on the problem inside the editor.
Comment 3 Lucas Bullen CLA 2017-11-17 11:06:59 EST
Created attachment 271530 [details]
hover in editor

Same result for hovering over the issue in the editor
Comment 4 Dani Megert CLA 2017-11-17 11:25:16 EST
OK, something must have changed since I reported it. I can see the hover now but it is non-standard. To much vertical space above and beyond the text.
Comment 5 Lucas Bullen CLA 2017-11-23 10:24:29 EST
(In reply to Dani Megert from comment #4)
> but it is non-standard. To much vertical space above and beyond the text.

That is because the GE's MarkerInformationControl is being used. I can make the margins smaller so that it looks better, but I think using this is better than using the standard drawer as the image gives a nice touch.

Look at image for removed margins (bottom image) against the original (top image) and tell me what you think.
Comment 6 Lucas Bullen CLA 2017-11-23 10:24:57 EST
Created attachment 271612 [details]
removed margins
Comment 7 Dani Megert CLA 2017-11-23 10:42:38 EST
(In reply to Lucas Bullen from comment #5)
> (In reply to Dani Megert from comment #4)
> > but it is non-standard. To much vertical space above and beyond the text.
> 
> That is because the GE's MarkerInformationControl is being used. I can make
> the margins smaller so that it looks better, but I think using this is
> better than using the standard drawer as the image gives a nice touch.
> 
> Look at image for removed margins (bottom image) against the original (top
> image) and tell me what you think.

It's not a question of "nicer". *all* editors use the hover like e.g. in the Java editor. So, this is about consistency. Currently the Generic Editor looks like ignoring what all others do and looks like a foreigner.
Comment 8 Mickael Istria CLA 2017-11-23 10:48:22 EST
The hover from Generic Editor is extensible, in a way that it can be coumpound of multiple hover providers, and may aggregate mutliple information controls. Because of this composite nature, it cannot be simply a BrowserInformationControl like most other editors.
That said, we can for sure tweak it so it looks nicer and more consistent with other hover dialogs.
Comment 9 Eclipse Genie CLA 2017-11-23 15:38:51 EST
New Gerrit change created: https://git.eclipse.org/r/112206
Comment 11 Dani Megert CLA 2017-12-01 04:47:54 EST
(In reply to Dani Megert from comment #4)
> OK, something must have changed since I reported it. I can see the hover now
> but it is non-standard. To much vertical space above and beyond the text.

I can reproduce it and know why it sometimes works for us: It works when opening the Generic Editor without the .project example but when the example is present, then no hover appears.

1. Start new target workspace out of the IDE with the .proiject example
2. Create a new Java project 'P'
3. Remove filters from Package Explorer
4. Open .project with the Generic Editor
==> file opens with folding and syntax coloring (example is running)
5. Change the javanature to javanfsgature
6. Save
7. Hover over the warning
==> no hover and an IAE in the .log:


!ENTRY org.eclipse.ui 4 0 2017-12-01 10:40:51.647
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalArgumentException: Buffer size <= 0
	at java.io.BufferedReader.<init>(BufferedReader.java:103)
	at org.eclipse.jface.internal.text.link.contentassist.LineBreakingReader.<init>(LineBreakingReader.java:57)
	at org.eclipse.jface.internal.text.html.HTMLTextPresenter.updatePresentation(HTMLTextPresenter.java:126)
	at org.eclipse.jface.text.DefaultInformationControl.setInformation(DefaultInformationControl.java:337)
	at org.eclipse.ui.internal.genericeditor.hover.CompositeInformationControl.setInput(CompositeInformationControl.java:74)
	at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1192)
	at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1161)
	at org.eclipse.jface.text.AbstractHoverInformationControlManager.presentInformation(AbstractHoverInformationControlManager.java:894)
	at org.eclipse.jface.text.TextViewerHoverManager.doPresentInformation(TextViewerHoverManager.java:248)
	at org.eclipse.jface.text.TextViewerHoverManager.lambda$0(TextViewerHoverManager.java:238)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4213)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3820)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:681)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:595)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Comment 12 Eclipse Genie CLA 2017-12-01 11:06:18 EST
New Gerrit change created: https://git.eclipse.org/r/112712
Comment 14 Mickael Istria CLA 2017-12-01 13:23:33 EST
Thank you Dani for the report and the details, and Lucas for the patch!
Comment 15 Lucas Bullen CLA 2018-01-22 13:11:29 EST
Verified fixed in I20180122-0800