Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Mouse hover with debugger perspective

Thanks for looking into this, Greg.

I haven't had any time to work on Photran recently, but I'm hoping to soon.  There are several things on the backlog I'd like to address.

If anyone else wants to work on this, you're welcome to - just let us know - and otherwise I'll see what I can do...

Jeff


On Tue, Sep 27, 2016 at 12:10 PM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:
Jeff,

Here’s my take on what needs to be done.

To start with, you should clone the photon and CDT git repos, then add all the plugins to your workspace. You might want to remove some of the CDT plugins that don’t build or that are not relevant. You’re really only going to be using the CDT plugins for reference.

Text hovering is something provided by a SourceViewerConfiguration which is a property of an editor. You can see where it is created by looking at the constructor for org.eclipse.photran.internal.ui.editor.FortranEditor (in the o.e.photran.ui plugin). The actual SourceViewerConfiguration gets created by the o.e.photran.internal.ui.editor_vpg.FortranVPGSourceViewerConfigurationFactory class in the o.e.photran.ui.vpg plugin. In this class you’ll see a method called getTextHover. Currently only a FortranDeclarationHover is created.

Now the trick is that getTextHover only allows one hover to be provided at a time. The way CDT gets around this is to use a “fake” hover called BestMatchHover which scans a list of all the hovers (CDT has many: annotations, docs, macro expansion, debugger, etc.) and uses the “best” one. Which is “best” is determined by the order they are in the list, and which one works. The debugger hover is first in the list, so it gets tried first. If the debugger is running, the hover will work, so it is used. If the debugger is not running, it won’t work, so the next one in the list will be tried, etc. CDT hovers are provided using an extension point called org.eclipse.cdt.ui.textHovers which are loaded when CDT starts.

For Photran, I think it can be a bit simpler. I would copy the BestMatchHover (class o.e.cdt.internal.ui.text.c.hover.BestMatchHover in the o.e.cdt.ui plugin) into the same package as the FortranDeclarationHover and modify it so that it tries the CDT debugger hover first, then the FotranDeclarationHover second. Then replace where FortranDeclarationHover is instantiated with BestMatchHover. The only complicated bit is that you can’t directly access the CDT debugger hover (class o.e.cdt.debug.internal.ui.editors.DelegatingDebugTextHover in the o.e.cdt.debug.ui plugin) because it’s in an internal package. Instead, you’ll need to check the extensions for the org.eclipse.cdt.ui.textHovers extension point and look for one with the label “Debugger”. You can then instantiate this class and use it from BestMatchHover. You can see how to do this by looking at the o.e.cdt.internal.ui.text.c.hover.CEditorTextHoverDescriptor class in the o.e.cdt.ui plugin. In fact, I’d copy this class into Photran and use it as a starting point as well, since it is internal also.

That’s pretty much all there should be to it. If you’d like further clarification or don’t understand something, please let me know.

Regards,
Greg

---------- Forwarded message ---------
From: Greg Watson <g.watson@xxxxxxxxxxxx>
Date: Wed, Sep 21, 2016 at 7:09 PM
Subject: Re: [photran] Mouse hover with debugger perspective
To: Photran Information <photran@xxxxxxxxxxx>


The short answer is that has never been possible. The hover is provided by the editor (in this case the Fortran editor), and the only hover control provided is one to display a declaration. It would probably take a day or two to hook up a hover control for the debugger using the one that CDT provides.

Regards,
Greg


On Sep 18, 2016, at 9:04 PM, Nicolás Biocca <biocca.nicolas@xxxxxxxxx> wrote:

Yes, I use eclipse CDT 9.0

El sept. 18, 2016 21:40, "Greg Watson" <g.watson@xxxxxxxxxxxx> escribió:
Eclipse version? Which Eclipse debugger are you using? CDT’s?

Greg

On Sep 18, 2016, at 8:17 PM, Nicolás Biocca <biocca.nicolas@xxxxxxxxx> wrote:

Hi Greg, I'm using gdb 7.10

El sept. 18, 2016 20:57, "Greg Watson" <g.watson@xxxxxxxxxxxx> escribió:
Which debugger are you using?

Regards,
Greg

On Sep 18, 2016, at 11:55 AM, Nicolás Biocca <biocca.nicolas@xxxxxxxxx> wrote:

No Ali, I have not been lucky yet.  But it seems a good opportunity to revive the thread.

Regards

Nicolás.

El sept. 14, 2016 22:19, "Ali Shahbazian" <aas@xxxxxxxxxxx> escribió:

Hi Nicolás,

 

Any success on showing a variable value by mouse hovering in Fortran?  I tried a few options in window>preferences but still no luck L

 

Ali

 

From: photran-bounces@xxxxxxxxxxx [mailto:photran-bounces@eclipse.org] On Behalf Of Nicolás Biocca
Sent: Wednesday, July 13, 2016 10:40 AM
To: Photran Information
Subject: [photran] Mouse hover with debugger perspective

 

Hello everybody,


Anyone knows how to show the value of a variable (arrays to) with a mouse hover? I know that this is possible with C/C++ but i can't find it in Fortran.

Thanks in advance.

Nicolás.


_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran
_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran


_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran
_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran


_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran
_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran

_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran


_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/photran


Back to the top