pydev-code Mailing List for PyDev for Eclipse (Page 6)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(14) |
Apr
(18) |
May
(12) |
Jun
(34) |
Jul
(31) |
Aug
(37) |
Sep
(22) |
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(4) |
Mar
(9) |
Apr
(1) |
May
|
Jun
(2) |
Jul
(24) |
Aug
(3) |
Sep
(5) |
Oct
(3) |
Nov
(3) |
Dec
(5) |
2006 |
Jan
(5) |
Feb
(23) |
Mar
(5) |
Apr
(80) |
May
(26) |
Jun
(13) |
Jul
(13) |
Aug
(4) |
Sep
(31) |
Oct
(24) |
Nov
(6) |
Dec
(2) |
2007 |
Jan
(7) |
Feb
|
Mar
(26) |
Apr
(3) |
May
(8) |
Jun
(6) |
Jul
(11) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
(3) |
2008 |
Jan
(7) |
Feb
(1) |
Mar
(6) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
(6) |
Sep
(10) |
Oct
(5) |
Nov
(8) |
Dec
(5) |
2009 |
Jan
(8) |
Feb
(10) |
Mar
(10) |
Apr
(1) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(3) |
Sep
(12) |
Oct
(6) |
Nov
(22) |
Dec
(12) |
2010 |
Jan
(10) |
Feb
(17) |
Mar
(5) |
Apr
(9) |
May
(8) |
Jun
(2) |
Jul
(4) |
Aug
(12) |
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
|
2011 |
Jan
(14) |
Feb
(8) |
Mar
(3) |
Apr
(11) |
May
(6) |
Jun
(5) |
Jul
(10) |
Aug
(7) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
(8) |
2012 |
Jan
|
Feb
(8) |
Mar
(10) |
Apr
(5) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(11) |
Nov
(1) |
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(11) |
Apr
(10) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(20) |
Sep
(4) |
Oct
(18) |
Nov
(5) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(5) |
Mar
(7) |
Apr
(5) |
May
(10) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(1) |
Feb
(1) |
Mar
(8) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
(3) |
Nov
(5) |
Dec
(1) |
2016 |
Jan
(26) |
Feb
(10) |
Mar
(4) |
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(3) |
2017 |
Jan
(3) |
Feb
|
Mar
(9) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(9) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
|
2018 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
(3) |
2019 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(11) |
2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Mark L. <mid...@ve...> - 2016-01-20 05:11:58
|
Thanks for the helpful feedback, Jonah. I want to clarify that pull request 155 is unrelated to the issue discussed in this thread. It's just a simple implementation of a suggestion Fabio made to a question I asked in Stack Overflow ( http://stackoverflow.com/a/34788905/2036650). It addresses an issue I encountered wherein string and comment arguments have no hover behavior implemented. It seems quite likely that PR #155 implementation will be impacted by whatever is done for the larger issue of how to organize and prioritize hover participants. But since it was a simple change (and I wasn't aware of how the scope of this issue would expand), I went ahead with the pull request. I assume Fabio will take this discussion into account when he decides what to do with that pull request. And I will hold off on implementing anything for the larger issue until Fabio weighs in. But for my part, all your suggestions sound good to me. I think the preference page idea is a good one, and I also agree with providing all hover contributions via the extension point. One more clarification: when I referred to only one hover participant per plug-in being active, I was referring to what you described more appropriately, i.e. that only one participant will contribute info on a given hover event. In JDT, the hover participants are sorted in accordance with declaring plug-in dependency. So I believe two participants in the same plug-in would have a non-deterministic sort order, and the first one that is encountered and provides hover info would be the only one selected. With explicit hover priorities, the implementation could choose to combine hover info from multiple participants with the same priority value. -Mark On 1/19/16 7:01 PM, Jonah Graham wrote: > PS, I would wait until Fabio provided some initial feedback before > going gung-ho on this to make sure it lines up with his plans for > PyDev. > ~~~ > Jonah Graham > Kichwa Coders Ltd. > www.kichwacoders.com > > > On 19 January 2016 at 23:59, Jonah Graham <jo...@ki...> wrote: >> One thing on reviewing your pull request[1] I realized that for all >> audiences of this email that we are talking about pulling the >> extension point up a level, so that the extension point for Python >> hovers is for something of type ITextHover (of course you would need >> to maintain backwards compatibility and leave the existing extension >> point that uses IPyHoverParticipant, but that is an implementation >> issue to an extent). >> >> [1] https://github.com/fabioz/Pydev/pull/155 >> >> Jonah >> ~~~ >> Jonah Graham >> Kichwa Coders Ltd. >> www.kichwacoders.com >> >> >> On 19 January 2016 at 23:49, Jonah Graham <jo...@ki...> wrote: >>> Hi Mark, >>> >>>> Thanks, Jonah. That's very helpful. >>> No problem, here is some more input. >>> >>>> I see that the JDT implementation >>>> determines the priority of the hover participants in accordance with the >>>> dependency hierarchy of the respective contributing plug-ins. I'd like to >>>> get get your opinion (or others) on the usefulness of declaring priorities >>>> explicitly as I described. >>> It seems to me explicit priorities have some significant advantages, >>> you wouldn't have declare order priorities and would not need a >>> comment like "<!-- Note: Do not change the sequence of those hover >>> contributions -->" [1]. >>> >>>> One advantage of that is that you could enable >>>> multiple participants to be active by assigning identical priorities. >>> The participants that are active are all the participants installed in >>> the active plug-ins that are enabled by the user. The priorities does >>> not limit them being active, just which one gets chosen for a >>> particular hover job. The BestMatchHover then iterates through all of >>> these in sorted order until the first one that returns an actual >>> hover. >>> This of course relies on having a BestMatchHover for PyDev and when it >>> is enabled it is the hover provider in use. The BestMatchHover should >>> typically be highest priority (but someone could write a higher >>> priority one, that like BestMatchHover delegated to other hovers) >>> >>>> It looks like in the JDT implementation the assumption is that no more than one >>>> participant will be declared per plug-in, so you cannot have more than one >>>> participant contribute hover info. >>> The standard JDT hovers are all in the one plug-in [1] except the >>> debug ones which are contributed by debug plug-in. >>> >>>> It also seems more useful to me to >>>> control the priority explicitly, rather than have it follow the plug-in >>>> dependency hierarchy. You may have a plug-in which doesn't override other >>>> plug-in behavior but whose hover nevertheless needs to override other >>>> hovers. Or maybe that's not very likely. I don't have an actual use case in >>>> mind. >>> I ran into an actual use case a while ago for a customer. I needed to >>> provide a special hover under some condition[2], but it was not >>> possible to make my hover higher priority with the current scheme. So >>> as this was a fully custom IDE, I put a workaround[3] to prioritise my >>> hover above the natural order they are discovered in. So yes a vote >>> for explicit priorities. I suspect if someone wrote a patch for JDT >>> for explicit priorities (with a reasonable default) it would be >>> accepted. Such an improvement would be nice with a preference page >>> that simply allowed sorting them in the right order too BTW. >>> >>>> Also there doesn't seem to be in JDT the PyDev equivalent of TextHover >>>> implementations separate from those declared via hover participant >>>> extensions (i.e. marker hover and docstring hover as invoked in >>>> PyTextHover). So the PyDev implementation will be different at least on that >>>> score. >>> This is a case where I think that part of PyDev needs to be changed if >>> you adopt your solution. All the hovers should be declared through the >>> extension point, only the extension point declared priority makes the >>> PyDev built-in one more important (unless your third-party one is even >>> higher priority of course, and through the preference page a user can >>> disable your one!). PyDev has its hover hardcoded (as you know, but >>> others reading may not) in the extended TextSourceViewerConfiguration >>> [4] but the JDT uses the hover that comes from the extension point [5] >>> >>> >>> [1] https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/plugin.xml#n473 >>> [2] The customer wanted some special API documentation to be showed if >>> specific symbols were hovered over. Not a general use case, but it was >>> annoying the API did not allow me to do it. >>> [3] by modifying the sorter in the plug-in >>> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaPlugin.java#n783 >>> that way the combined hover would see my special one ahead of the >>> standard one. >>> [4] https://github.com/fabioz/Pydev/blob/development/plugins/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java#L74 >>> [5]https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java#n673 >>> >>> ~~~ >>> Jonah Graham >>> Kichwa Coders Ltd. >>> www.kichwacoders.com >>> >>> >>> On 19 January 2016 at 23:06, Mark Leone <mid...@ve...> wrote: >>>> Thanks, Jonah. That's very helpful. I see that the JDT implementation >>>> determines the priority of the hover participants in accordance with the >>>> dependency hierarchy of the respective contributing plug-ins. I'd like to >>>> get get your opinion (or others) on the usefulness of declaring priorities >>>> explicitly as I described. One advantage of that is that you could enable >>>> multiple participants to be active by assigning identical priorities. It >>>> looks like in the JDT implementation the assumption is that no more than one >>>> participant will be declared per plug-in, so you cannot have more than one >>>> participant contribute hover info. It also seems more useful to me to >>>> control the priority explicitly, rather than have it follow the plug-in >>>> dependency hierarchy. You may have a plug-in which doesn't override other >>>> plug-in behavior but whose hover nevertheless needs to override other >>>> hovers. Or maybe that's not very likely. I don't have an actual use case in >>>> mind. >>>> >>>> Also there doesn't seem to be in JDT the PyDev equivalent of TextHover >>>> implementations separate from those declared via hover participant >>>> extensions (i.e. marker hover and docstring hover as invoked in >>>> PyTextHover). So the PyDev implementation will be different at least on that >>>> score. >>>> >>>> -Mark >>>> >>>> >>>> On 01/19/2016 01:25 PM, Jonah Graham wrote: >>>> >>>> HI Mark, >>>> >>>> To me it sounds like you are on the right track. >>>> >>>> What I recommend in addition is you consider reusing JDT's Hover code >>>> as it already has a lot of that logic. You may want to copy the code >>>> as I believe that is what CDT did for the same feature and I wouldn't >>>> be suprised if other language tools have too. I think there is a bug >>>> in bugs.eclipse.org about moving the functionality from JDT to >>>> platform to make it easier to reused, but I couldn't find it. >>>> >>>> This is the JDT extension point: >>>> http://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_javaEditorTextHovers.html?cp=3_1_1_31 >>>> This is the CDT one: >>>> http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_ui_textHovers.html?cp=14_1_1_39 >>>> >>>> And then there is a "meta" hover called the combined hover that >>>> chooses the best other hover installed to display: >>>> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/BestMatchHover.java >>>> >>>> The preferences UI (see attached screenshot, but I am sure you can >>>> find it in your Eclipse too) is for controlling and overriding: >>>> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java >>>> >>>> Jonah >>>> ~~~ >>>> Jonah Graham >>>> Kichwa Coders Ltd. >>>> www.kichwacoders.com >>>> >>>> >>>> On 19 January 2016 at 17:35, Mark Leone <mid...@ve...> wrote: >>>> >>>> I'm making a change to PyDev and will submit a pull request if >>>> appropriate. But I'd like to know if there's a better way to do what I'm >>>> trying to do, or if the behavior I'm after is not of general interest. >>>> >>>> The issue I'm having is that I implemented a hover participant, and I'd >>>> like it to preempt the TextHover contributions from PyDev when it has >>>> something to contribute. This was a simple change, including the >>>> addition of a preference to toggle the behavior of ignoring PyDev's >>>> TextHover info when one or more hover participants contributes hover info. >>>> >>>> However, it seems I should probably make a more general mod as well, >>>> even though the above meets my current use case. What I have in mind is >>>> to add two attributes to the hover participant extension point. One >>>> attribute is an integer that specifies priority, and the other is a >>>> boolean that specifies whether or not to preempt PyDev's built-in >>>> TextHover. The behavior will be that registered hover participants will >>>> be called in decreasing priority order, and as soon as one contributes >>>> hover info, the remaining participants are not invoked. If any >>>> participant contributes hover info, the built-in PyDev TextHover will be >>>> invoked subsequently only if the aforementioned boolean attribute for >>>> the contributing participant specifies that PyDev TextHover should not >>>> be ignored. >>>> >>>> Does this make sense? Is there a better way to approach it? Is this >>>> behavior of general interest? >>>> >>>> -Mark >>>> >>>> ------------------------------------------------------------------------------ >>>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>>> Monitor end-to-end web transactions and take corrective actions now >>>> Troubleshoot faster and improve end-user experience. Signup Now! >>>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>>> Monitor end-to-end web transactions and take corrective actions now >>>> Troubleshoot faster and improve end-user experience. Signup Now! >>>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >>>> >>>> >>>> >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>>> Monitor end-to-end web transactions and take corrective actions now >>>> Troubleshoot faster and improve end-user experience. Signup Now! >>>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Jonah G. <jo...@ki...> - 2016-01-20 00:02:45
|
PS, I would wait until Fabio provided some initial feedback before going gung-ho on this to make sure it lines up with his plans for PyDev. ~~~ Jonah Graham Kichwa Coders Ltd. www.kichwacoders.com On 19 January 2016 at 23:59, Jonah Graham <jo...@ki...> wrote: > One thing on reviewing your pull request[1] I realized that for all > audiences of this email that we are talking about pulling the > extension point up a level, so that the extension point for Python > hovers is for something of type ITextHover (of course you would need > to maintain backwards compatibility and leave the existing extension > point that uses IPyHoverParticipant, but that is an implementation > issue to an extent). > > [1] https://github.com/fabioz/Pydev/pull/155 > > Jonah > ~~~ > Jonah Graham > Kichwa Coders Ltd. > www.kichwacoders.com > > > On 19 January 2016 at 23:49, Jonah Graham <jo...@ki...> wrote: >> Hi Mark, >> >>> Thanks, Jonah. That's very helpful. >> No problem, here is some more input. >> >>> I see that the JDT implementation >>> determines the priority of the hover participants in accordance with the >>> dependency hierarchy of the respective contributing plug-ins. I'd like to >>> get get your opinion (or others) on the usefulness of declaring priorities >>> explicitly as I described. >> It seems to me explicit priorities have some significant advantages, >> you wouldn't have declare order priorities and would not need a >> comment like "<!-- Note: Do not change the sequence of those hover >> contributions -->" [1]. >> >>> One advantage of that is that you could enable >>> multiple participants to be active by assigning identical priorities. >> The participants that are active are all the participants installed in >> the active plug-ins that are enabled by the user. The priorities does >> not limit them being active, just which one gets chosen for a >> particular hover job. The BestMatchHover then iterates through all of >> these in sorted order until the first one that returns an actual >> hover. >> This of course relies on having a BestMatchHover for PyDev and when it >> is enabled it is the hover provider in use. The BestMatchHover should >> typically be highest priority (but someone could write a higher >> priority one, that like BestMatchHover delegated to other hovers) >> >>> It looks like in the JDT implementation the assumption is that no more than one >>> participant will be declared per plug-in, so you cannot have more than one >>> participant contribute hover info. >> The standard JDT hovers are all in the one plug-in [1] except the >> debug ones which are contributed by debug plug-in. >> >>> It also seems more useful to me to >>> control the priority explicitly, rather than have it follow the plug-in >>> dependency hierarchy. You may have a plug-in which doesn't override other >>> plug-in behavior but whose hover nevertheless needs to override other >>> hovers. Or maybe that's not very likely. I don't have an actual use case in >>> mind. >> I ran into an actual use case a while ago for a customer. I needed to >> provide a special hover under some condition[2], but it was not >> possible to make my hover higher priority with the current scheme. So >> as this was a fully custom IDE, I put a workaround[3] to prioritise my >> hover above the natural order they are discovered in. So yes a vote >> for explicit priorities. I suspect if someone wrote a patch for JDT >> for explicit priorities (with a reasonable default) it would be >> accepted. Such an improvement would be nice with a preference page >> that simply allowed sorting them in the right order too BTW. >> >>> Also there doesn't seem to be in JDT the PyDev equivalent of TextHover >>> implementations separate from those declared via hover participant >>> extensions (i.e. marker hover and docstring hover as invoked in >>> PyTextHover). So the PyDev implementation will be different at least on that >>> score. >> This is a case where I think that part of PyDev needs to be changed if >> you adopt your solution. All the hovers should be declared through the >> extension point, only the extension point declared priority makes the >> PyDev built-in one more important (unless your third-party one is even >> higher priority of course, and through the preference page a user can >> disable your one!). PyDev has its hover hardcoded (as you know, but >> others reading may not) in the extended TextSourceViewerConfiguration >> [4] but the JDT uses the hover that comes from the extension point [5] >> >> >> [1] https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/plugin.xml#n473 >> [2] The customer wanted some special API documentation to be showed if >> specific symbols were hovered over. Not a general use case, but it was >> annoying the API did not allow me to do it. >> [3] by modifying the sorter in the plug-in >> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaPlugin.java#n783 >> that way the combined hover would see my special one ahead of the >> standard one. >> [4] https://github.com/fabioz/Pydev/blob/development/plugins/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java#L74 >> [5]https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java#n673 >> >> ~~~ >> Jonah Graham >> Kichwa Coders Ltd. >> www.kichwacoders.com >> >> >> On 19 January 2016 at 23:06, Mark Leone <mid...@ve...> wrote: >>> Thanks, Jonah. That's very helpful. I see that the JDT implementation >>> determines the priority of the hover participants in accordance with the >>> dependency hierarchy of the respective contributing plug-ins. I'd like to >>> get get your opinion (or others) on the usefulness of declaring priorities >>> explicitly as I described. One advantage of that is that you could enable >>> multiple participants to be active by assigning identical priorities. It >>> looks like in the JDT implementation the assumption is that no more than one >>> participant will be declared per plug-in, so you cannot have more than one >>> participant contribute hover info. It also seems more useful to me to >>> control the priority explicitly, rather than have it follow the plug-in >>> dependency hierarchy. You may have a plug-in which doesn't override other >>> plug-in behavior but whose hover nevertheless needs to override other >>> hovers. Or maybe that's not very likely. I don't have an actual use case in >>> mind. >>> >>> Also there doesn't seem to be in JDT the PyDev equivalent of TextHover >>> implementations separate from those declared via hover participant >>> extensions (i.e. marker hover and docstring hover as invoked in >>> PyTextHover). So the PyDev implementation will be different at least on that >>> score. >>> >>> -Mark >>> >>> >>> On 01/19/2016 01:25 PM, Jonah Graham wrote: >>> >>> HI Mark, >>> >>> To me it sounds like you are on the right track. >>> >>> What I recommend in addition is you consider reusing JDT's Hover code >>> as it already has a lot of that logic. You may want to copy the code >>> as I believe that is what CDT did for the same feature and I wouldn't >>> be suprised if other language tools have too. I think there is a bug >>> in bugs.eclipse.org about moving the functionality from JDT to >>> platform to make it easier to reused, but I couldn't find it. >>> >>> This is the JDT extension point: >>> http://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_javaEditorTextHovers.html?cp=3_1_1_31 >>> This is the CDT one: >>> http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_ui_textHovers.html?cp=14_1_1_39 >>> >>> And then there is a "meta" hover called the combined hover that >>> chooses the best other hover installed to display: >>> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/BestMatchHover.java >>> >>> The preferences UI (see attached screenshot, but I am sure you can >>> find it in your Eclipse too) is for controlling and overriding: >>> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java >>> >>> Jonah >>> ~~~ >>> Jonah Graham >>> Kichwa Coders Ltd. >>> www.kichwacoders.com >>> >>> >>> On 19 January 2016 at 17:35, Mark Leone <mid...@ve...> wrote: >>> >>> I'm making a change to PyDev and will submit a pull request if >>> appropriate. But I'd like to know if there's a better way to do what I'm >>> trying to do, or if the behavior I'm after is not of general interest. >>> >>> The issue I'm having is that I implemented a hover participant, and I'd >>> like it to preempt the TextHover contributions from PyDev when it has >>> something to contribute. This was a simple change, including the >>> addition of a preference to toggle the behavior of ignoring PyDev's >>> TextHover info when one or more hover participants contributes hover info. >>> >>> However, it seems I should probably make a more general mod as well, >>> even though the above meets my current use case. What I have in mind is >>> to add two attributes to the hover participant extension point. One >>> attribute is an integer that specifies priority, and the other is a >>> boolean that specifies whether or not to preempt PyDev's built-in >>> TextHover. The behavior will be that registered hover participants will >>> be called in decreasing priority order, and as soon as one contributes >>> hover info, the remaining participants are not invoked. If any >>> participant contributes hover info, the built-in PyDev TextHover will be >>> invoked subsequently only if the aforementioned boolean attribute for >>> the contributing participant specifies that PyDev TextHover should not >>> be ignored. >>> >>> Does this make sense? Is there a better way to approach it? Is this >>> behavior of general interest? >>> >>> -Mark >>> >>> ------------------------------------------------------------------------------ >>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>> Monitor end-to-end web transactions and take corrective actions now >>> Troubleshoot faster and improve end-user experience. Signup Now! >>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>> Monitor end-to-end web transactions and take corrective actions now >>> Troubleshoot faster and improve end-user experience. Signup Now! >>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >>> >>> >>> >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>> Monitor end-to-end web transactions and take corrective actions now >>> Troubleshoot faster and improve end-user experience. Signup Now! >>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> |
From: Jonah G. <jo...@ki...> - 2016-01-20 00:00:35
|
One thing on reviewing your pull request[1] I realized that for all audiences of this email that we are talking about pulling the extension point up a level, so that the extension point for Python hovers is for something of type ITextHover (of course you would need to maintain backwards compatibility and leave the existing extension point that uses IPyHoverParticipant, but that is an implementation issue to an extent). [1] https://github.com/fabioz/Pydev/pull/155 Jonah ~~~ Jonah Graham Kichwa Coders Ltd. www.kichwacoders.com On 19 January 2016 at 23:49, Jonah Graham <jo...@ki...> wrote: > Hi Mark, > >> Thanks, Jonah. That's very helpful. > No problem, here is some more input. > >> I see that the JDT implementation >> determines the priority of the hover participants in accordance with the >> dependency hierarchy of the respective contributing plug-ins. I'd like to >> get get your opinion (or others) on the usefulness of declaring priorities >> explicitly as I described. > It seems to me explicit priorities have some significant advantages, > you wouldn't have declare order priorities and would not need a > comment like "<!-- Note: Do not change the sequence of those hover > contributions -->" [1]. > >> One advantage of that is that you could enable >> multiple participants to be active by assigning identical priorities. > The participants that are active are all the participants installed in > the active plug-ins that are enabled by the user. The priorities does > not limit them being active, just which one gets chosen for a > particular hover job. The BestMatchHover then iterates through all of > these in sorted order until the first one that returns an actual > hover. > This of course relies on having a BestMatchHover for PyDev and when it > is enabled it is the hover provider in use. The BestMatchHover should > typically be highest priority (but someone could write a higher > priority one, that like BestMatchHover delegated to other hovers) > >> It looks like in the JDT implementation the assumption is that no more than one >> participant will be declared per plug-in, so you cannot have more than one >> participant contribute hover info. > The standard JDT hovers are all in the one plug-in [1] except the > debug ones which are contributed by debug plug-in. > >> It also seems more useful to me to >> control the priority explicitly, rather than have it follow the plug-in >> dependency hierarchy. You may have a plug-in which doesn't override other >> plug-in behavior but whose hover nevertheless needs to override other >> hovers. Or maybe that's not very likely. I don't have an actual use case in >> mind. > I ran into an actual use case a while ago for a customer. I needed to > provide a special hover under some condition[2], but it was not > possible to make my hover higher priority with the current scheme. So > as this was a fully custom IDE, I put a workaround[3] to prioritise my > hover above the natural order they are discovered in. So yes a vote > for explicit priorities. I suspect if someone wrote a patch for JDT > for explicit priorities (with a reasonable default) it would be > accepted. Such an improvement would be nice with a preference page > that simply allowed sorting them in the right order too BTW. > >> Also there doesn't seem to be in JDT the PyDev equivalent of TextHover >> implementations separate from those declared via hover participant >> extensions (i.e. marker hover and docstring hover as invoked in >> PyTextHover). So the PyDev implementation will be different at least on that >> score. > This is a case where I think that part of PyDev needs to be changed if > you adopt your solution. All the hovers should be declared through the > extension point, only the extension point declared priority makes the > PyDev built-in one more important (unless your third-party one is even > higher priority of course, and through the preference page a user can > disable your one!). PyDev has its hover hardcoded (as you know, but > others reading may not) in the extended TextSourceViewerConfiguration > [4] but the JDT uses the hover that comes from the extension point [5] > > > [1] https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/plugin.xml#n473 > [2] The customer wanted some special API documentation to be showed if > specific symbols were hovered over. Not a general use case, but it was > annoying the API did not allow me to do it. > [3] by modifying the sorter in the plug-in > https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaPlugin.java#n783 > that way the combined hover would see my special one ahead of the > standard one. > [4] https://github.com/fabioz/Pydev/blob/development/plugins/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java#L74 > [5]https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java#n673 > > ~~~ > Jonah Graham > Kichwa Coders Ltd. > www.kichwacoders.com > > > On 19 January 2016 at 23:06, Mark Leone <mid...@ve...> wrote: >> Thanks, Jonah. That's very helpful. I see that the JDT implementation >> determines the priority of the hover participants in accordance with the >> dependency hierarchy of the respective contributing plug-ins. I'd like to >> get get your opinion (or others) on the usefulness of declaring priorities >> explicitly as I described. One advantage of that is that you could enable >> multiple participants to be active by assigning identical priorities. It >> looks like in the JDT implementation the assumption is that no more than one >> participant will be declared per plug-in, so you cannot have more than one >> participant contribute hover info. It also seems more useful to me to >> control the priority explicitly, rather than have it follow the plug-in >> dependency hierarchy. You may have a plug-in which doesn't override other >> plug-in behavior but whose hover nevertheless needs to override other >> hovers. Or maybe that's not very likely. I don't have an actual use case in >> mind. >> >> Also there doesn't seem to be in JDT the PyDev equivalent of TextHover >> implementations separate from those declared via hover participant >> extensions (i.e. marker hover and docstring hover as invoked in >> PyTextHover). So the PyDev implementation will be different at least on that >> score. >> >> -Mark >> >> >> On 01/19/2016 01:25 PM, Jonah Graham wrote: >> >> HI Mark, >> >> To me it sounds like you are on the right track. >> >> What I recommend in addition is you consider reusing JDT's Hover code >> as it already has a lot of that logic. You may want to copy the code >> as I believe that is what CDT did for the same feature and I wouldn't >> be suprised if other language tools have too. I think there is a bug >> in bugs.eclipse.org about moving the functionality from JDT to >> platform to make it easier to reused, but I couldn't find it. >> >> This is the JDT extension point: >> http://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_javaEditorTextHovers.html?cp=3_1_1_31 >> This is the CDT one: >> http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_ui_textHovers.html?cp=14_1_1_39 >> >> And then there is a "meta" hover called the combined hover that >> chooses the best other hover installed to display: >> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/BestMatchHover.java >> >> The preferences UI (see attached screenshot, but I am sure you can >> find it in your Eclipse too) is for controlling and overriding: >> https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java >> >> Jonah >> ~~~ >> Jonah Graham >> Kichwa Coders Ltd. >> www.kichwacoders.com >> >> >> On 19 January 2016 at 17:35, Mark Leone <mid...@ve...> wrote: >> >> I'm making a change to PyDev and will submit a pull request if >> appropriate. But I'd like to know if there's a better way to do what I'm >> trying to do, or if the behavior I'm after is not of general interest. >> >> The issue I'm having is that I implemented a hover participant, and I'd >> like it to preempt the TextHover contributions from PyDev when it has >> something to contribute. This was a simple change, including the >> addition of a preference to toggle the behavior of ignoring PyDev's >> TextHover info when one or more hover participants contributes hover info. >> >> However, it seems I should probably make a more general mod as well, >> even though the above meets my current use case. What I have in mind is >> to add two attributes to the hover participant extension point. One >> attribute is an integer that specifies priority, and the other is a >> boolean that specifies whether or not to preempt PyDev's built-in >> TextHover. The behavior will be that registered hover participants will >> be called in decreasing priority order, and as soon as one contributes >> hover info, the remaining participants are not invoked. If any >> participant contributes hover info, the built-in PyDev TextHover will be >> invoked subsequently only if the aforementioned boolean attribute for >> the contributing participant specifies that PyDev TextHover should not >> be ignored. >> >> Does this make sense? Is there a better way to approach it? Is this >> behavior of general interest? >> >> -Mark >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> >> >> >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> |
From: Jonah G. <jo...@ki...> - 2016-01-19 23:50:24
|
Hi Mark, > Thanks, Jonah. That's very helpful. No problem, here is some more input. > I see that the JDT implementation > determines the priority of the hover participants in accordance with the > dependency hierarchy of the respective contributing plug-ins. I'd like to > get get your opinion (or others) on the usefulness of declaring priorities > explicitly as I described. It seems to me explicit priorities have some significant advantages, you wouldn't have declare order priorities and would not need a comment like "<!-- Note: Do not change the sequence of those hover contributions -->" [1]. > One advantage of that is that you could enable > multiple participants to be active by assigning identical priorities. The participants that are active are all the participants installed in the active plug-ins that are enabled by the user. The priorities does not limit them being active, just which one gets chosen for a particular hover job. The BestMatchHover then iterates through all of these in sorted order until the first one that returns an actual hover. This of course relies on having a BestMatchHover for PyDev and when it is enabled it is the hover provider in use. The BestMatchHover should typically be highest priority (but someone could write a higher priority one, that like BestMatchHover delegated to other hovers) > It looks like in the JDT implementation the assumption is that no more than one > participant will be declared per plug-in, so you cannot have more than one > participant contribute hover info. The standard JDT hovers are all in the one plug-in [1] except the debug ones which are contributed by debug plug-in. > It also seems more useful to me to > control the priority explicitly, rather than have it follow the plug-in > dependency hierarchy. You may have a plug-in which doesn't override other > plug-in behavior but whose hover nevertheless needs to override other > hovers. Or maybe that's not very likely. I don't have an actual use case in > mind. I ran into an actual use case a while ago for a customer. I needed to provide a special hover under some condition[2], but it was not possible to make my hover higher priority with the current scheme. So as this was a fully custom IDE, I put a workaround[3] to prioritise my hover above the natural order they are discovered in. So yes a vote for explicit priorities. I suspect if someone wrote a patch for JDT for explicit priorities (with a reasonable default) it would be accepted. Such an improvement would be nice with a preference page that simply allowed sorting them in the right order too BTW. > Also there doesn't seem to be in JDT the PyDev equivalent of TextHover > implementations separate from those declared via hover participant > extensions (i.e. marker hover and docstring hover as invoked in > PyTextHover). So the PyDev implementation will be different at least on that > score. This is a case where I think that part of PyDev needs to be changed if you adopt your solution. All the hovers should be declared through the extension point, only the extension point declared priority makes the PyDev built-in one more important (unless your third-party one is even higher priority of course, and through the preference page a user can disable your one!). PyDev has its hover hardcoded (as you know, but others reading may not) in the extended TextSourceViewerConfiguration [4] but the JDT uses the hover that comes from the extension point [5] [1] https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/plugin.xml#n473 [2] The customer wanted some special API documentation to be showed if specific symbols were hovered over. Not a general use case, but it was annoying the API did not allow me to do it. [3] by modifying the sorter in the plug-in https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaPlugin.java#n783 that way the combined hover would see my special one ahead of the standard one. [4] https://github.com/fabioz/Pydev/blob/development/plugins/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java#L74 [5]https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java#n673 ~~~ Jonah Graham Kichwa Coders Ltd. www.kichwacoders.com On 19 January 2016 at 23:06, Mark Leone <mid...@ve...> wrote: > Thanks, Jonah. That's very helpful. I see that the JDT implementation > determines the priority of the hover participants in accordance with the > dependency hierarchy of the respective contributing plug-ins. I'd like to > get get your opinion (or others) on the usefulness of declaring priorities > explicitly as I described. One advantage of that is that you could enable > multiple participants to be active by assigning identical priorities. It > looks like in the JDT implementation the assumption is that no more than one > participant will be declared per plug-in, so you cannot have more than one > participant contribute hover info. It also seems more useful to me to > control the priority explicitly, rather than have it follow the plug-in > dependency hierarchy. You may have a plug-in which doesn't override other > plug-in behavior but whose hover nevertheless needs to override other > hovers. Or maybe that's not very likely. I don't have an actual use case in > mind. > > Also there doesn't seem to be in JDT the PyDev equivalent of TextHover > implementations separate from those declared via hover participant > extensions (i.e. marker hover and docstring hover as invoked in > PyTextHover). So the PyDev implementation will be different at least on that > score. > > -Mark > > > On 01/19/2016 01:25 PM, Jonah Graham wrote: > > HI Mark, > > To me it sounds like you are on the right track. > > What I recommend in addition is you consider reusing JDT's Hover code > as it already has a lot of that logic. You may want to copy the code > as I believe that is what CDT did for the same feature and I wouldn't > be suprised if other language tools have too. I think there is a bug > in bugs.eclipse.org about moving the functionality from JDT to > platform to make it easier to reused, but I couldn't find it. > > This is the JDT extension point: > http://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_javaEditorTextHovers.html?cp=3_1_1_31 > This is the CDT one: > http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_ui_textHovers.html?cp=14_1_1_39 > > And then there is a "meta" hover called the combined hover that > chooses the best other hover installed to display: > https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/BestMatchHover.java > > The preferences UI (see attached screenshot, but I am sure you can > find it in your Eclipse too) is for controlling and overriding: > https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java > > Jonah > ~~~ > Jonah Graham > Kichwa Coders Ltd. > www.kichwacoders.com > > > On 19 January 2016 at 17:35, Mark Leone <mid...@ve...> wrote: > > I'm making a change to PyDev and will submit a pull request if > appropriate. But I'd like to know if there's a better way to do what I'm > trying to do, or if the behavior I'm after is not of general interest. > > The issue I'm having is that I implemented a hover participant, and I'd > like it to preempt the TextHover contributions from PyDev when it has > something to contribute. This was a simple change, including the > addition of a preference to toggle the behavior of ignoring PyDev's > TextHover info when one or more hover participants contributes hover info. > > However, it seems I should probably make a more general mod as well, > even though the above meets my current use case. What I have in mind is > to add two attributes to the hover participant extension point. One > attribute is an integer that specifies priority, and the other is a > boolean that specifies whether or not to preempt PyDev's built-in > TextHover. The behavior will be that registered hover participants will > be called in decreasing priority order, and as soon as one contributes > hover info, the remaining participants are not invoked. If any > participant contributes hover info, the built-in PyDev TextHover will be > invoked subsequently only if the aforementioned boolean attribute for > the contributing participant specifies that PyDev TextHover should not > be ignored. > > Does this make sense? Is there a better way to approach it? Is this > behavior of general interest? > > -Mark > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > > > > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Mark L. <mid...@ve...> - 2016-01-19 23:06:28
|
Thanks, Jonah. That's very helpful. I see that the JDT implementation determines the priority of the hover participants in accordance with the dependency hierarchy of the respective contributing plug-ins. I'd like to get get your opinion (or others) on the usefulness of declaring priorities explicitly as I described. One advantage of that is that you could enable multiple participants to be active by assigning identical priorities. It looks like in the JDT implementation the assumption is that no more than one participant will be declared per plug-in, so you cannot have more than one participant contribute hover info. It also seems more useful to me to control the priority explicitly, rather than have it follow the plug-in dependency hierarchy. You may have a plug-in which doesn't override other plug-in behavior but whose hover nevertheless needs to override other hovers. Or maybe that's not very likely. I don't have an actual use case in mind. Also there doesn't seem to be in JDT the PyDev equivalent of TextHover implementations separate from those declared via hover participant extensions (i.e. marker hover and docstring hover as invoked in PyTextHover). So the PyDev implementation will be different at least on that score. -Mark On 01/19/2016 01:25 PM, Jonah Graham wrote: > HI Mark, > > To me it sounds like you are on the right track. > > What I recommend in addition is you consider reusing JDT's Hover code > as it already has a lot of that logic. You may want to copy the code > as I believe that is what CDT did for the same feature and I wouldn't > be suprised if other language tools have too. I think there is a bug > in bugs.eclipse.org about moving the functionality from JDT to > platform to make it easier to reused, but I couldn't find it. > > This is the JDT extension point: > http://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_javaEditorTextHovers.html?cp=3_1_1_31 > This is the CDT one: > http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_ui_textHovers.html?cp=14_1_1_39 > > And then there is a "meta" hover called the combined hover that > chooses the best other hover installed to display: > https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/BestMatchHover.java > > The preferences UI (see attached screenshot, but I am sure you can > find it in your Eclipse too) is for controlling and overriding: > https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java > > Jonah > ~~~ > Jonah Graham > Kichwa Coders Ltd. > www.kichwacoders.com > > > On 19 January 2016 at 17:35, Mark Leone <mid...@ve...> wrote: >> I'm making a change to PyDev and will submit a pull request if >> appropriate. But I'd like to know if there's a better way to do what I'm >> trying to do, or if the behavior I'm after is not of general interest. >> >> The issue I'm having is that I implemented a hover participant, and I'd >> like it to preempt the TextHover contributions from PyDev when it has >> something to contribute. This was a simple change, including the >> addition of a preference to toggle the behavior of ignoring PyDev's >> TextHover info when one or more hover participants contributes hover info. >> >> However, it seems I should probably make a more general mod as well, >> even though the above meets my current use case. What I have in mind is >> to add two attributes to the hover participant extension point. One >> attribute is an integer that specifies priority, and the other is a >> boolean that specifies whether or not to preempt PyDev's built-in >> TextHover. The behavior will be that registered hover participants will >> be called in decreasing priority order, and as soon as one contributes >> hover info, the remaining participants are not invoked. If any >> participant contributes hover info, the built-in PyDev TextHover will be >> invoked subsequently only if the aforementioned boolean attribute for >> the contributing participant specifies that PyDev TextHover should not >> be ignored. >> >> Does this make sense? Is there a better way to approach it? Is this >> behavior of general interest? >> >> -Mark >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> >> >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code |
From: Jonah G. <jo...@ki...> - 2016-01-19 18:44:42
|
HI Mark, To me it sounds like you are on the right track. What I recommend in addition is you consider reusing JDT's Hover code as it already has a lot of that logic. You may want to copy the code as I believe that is what CDT did for the same feature and I wouldn't be suprised if other language tools have too. I think there is a bug in bugs.eclipse.org about moving the functionality from JDT to platform to make it easier to reused, but I couldn't find it. This is the JDT extension point: http://help.eclipse.org/mars/topic/org.eclipse.jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_javaEditorTextHovers.html?cp=3_1_1_31 This is the CDT one: http://help.eclipse.org/mars/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_ui_textHovers.html?cp=14_1_1_39 And then there is a "meta" hover called the combined hover that chooses the best other hover installed to display: https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/BestMatchHover.java The preferences UI (see attached screenshot, but I am sure you can find it in your Eclipse too) is for controlling and overriding: https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java Jonah ~~~ Jonah Graham Kichwa Coders Ltd. www.kichwacoders.com On 19 January 2016 at 17:35, Mark Leone <mid...@ve...> wrote: > I'm making a change to PyDev and will submit a pull request if > appropriate. But I'd like to know if there's a better way to do what I'm > trying to do, or if the behavior I'm after is not of general interest. > > The issue I'm having is that I implemented a hover participant, and I'd > like it to preempt the TextHover contributions from PyDev when it has > something to contribute. This was a simple change, including the > addition of a preference to toggle the behavior of ignoring PyDev's > TextHover info when one or more hover participants contributes hover info. > > However, it seems I should probably make a more general mod as well, > even though the above meets my current use case. What I have in mind is > to add two attributes to the hover participant extension point. One > attribute is an integer that specifies priority, and the other is a > boolean that specifies whether or not to preempt PyDev's built-in > TextHover. The behavior will be that registered hover participants will > be called in decreasing priority order, and as soon as one contributes > hover info, the remaining participants are not invoked. If any > participant contributes hover info, the built-in PyDev TextHover will be > invoked subsequently only if the aforementioned boolean attribute for > the contributing participant specifies that PyDev TextHover should not > be ignored. > > Does this make sense? Is there a better way to approach it? Is this > behavior of general interest? > > -Mark > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code |
From: Mark L. <mid...@ve...> - 2016-01-19 17:35:14
|
I'm making a change to PyDev and will submit a pull request if appropriate. But I'd like to know if there's a better way to do what I'm trying to do, or if the behavior I'm after is not of general interest. The issue I'm having is that I implemented a hover participant, and I'd like it to preempt the TextHover contributions from PyDev when it has something to contribute. This was a simple change, including the addition of a preference to toggle the behavior of ignoring PyDev's TextHover info when one or more hover participants contributes hover info. However, it seems I should probably make a more general mod as well, even though the above meets my current use case. What I have in mind is to add two attributes to the hover participant extension point. One attribute is an integer that specifies priority, and the other is a boolean that specifies whether or not to preempt PyDev's built-in TextHover. The behavior will be that registered hover participants will be called in decreasing priority order, and as soon as one contributes hover info, the remaining participants are not invoked. If any participant contributes hover info, the built-in PyDev TextHover will be invoked subsequently only if the aforementioned boolean attribute for the contributing participant specifies that PyDev TextHover should not be ignored. Does this make sense? Is there a better way to approach it? Is this behavior of general interest? -Mark |
From: Fabio Z. <fa...@gm...> - 2016-01-19 17:24:49
|
This isn't an issue in your code, it's just a warning from the pydev side in the hand-made parser (so, the proper thing here would be checking how to handle the constructs it's complaining about in the FastDefinitionsParser). On Tue, Jan 19, 2016 at 2:47 PM, Mark Leone <mid...@ve...> wrote: > My RCP app was using http://pydev.org/updates for PyDev, which was > upgraded yesterday (I think) from PyDev 4.4 to 4.5. I'm using 4.4 now > after switching to https://dl.bintray.com/fabioz/pydev/all/, but I'd > like to run with 4.5, and I have a problem with it. > > When I launch the app, the console gets flooded with numerous instances > of the stack trace below. The line of my code that leads to the > exception (MidasActivator line 339) is this > > IInterpreterManager manager = ... > manager.setInfos(new IInterpreterInfo[] {xmpyInterp}, null, new > NullProgressMonitor()); > > I'm updating the python interpreter there after adding a pypredef location. > > This doesn't happen in PyDev 4.4. Also it doesn't happen in PyDev 4.5 if > I omit the com.python.pydev plug-ins from my product (specifically > com.python.pydev.analysis). In that case, I get an NPE when PyDev checks > if the interpreters are synced with the environment. I can prevent that > exception my implementing a contribution to extension > org.python.pydev.pydev_interpreter_info_builder which does nothing. > > So I don't know if I've got something in my code that is incompatible > with PyDev 4.5, or is implementing an info builder extension that does > nothing the expected pattern? I would think that including the > com.python.pydev plug-ins is expected, in whch case I need to figure out > why I get exceptions when I do. > > !ENTRY org.python.pydev.shared_core 4 4 2016-01-19 11:24:53.650 > !MESSAGE Did not expect to find item below node: > Assign[targets=[Name[id=this, ctx=Store, reserved=false]], value=null] > (module: __init__.py). > !STACK 0 > java.lang.RuntimeException: Did not expect to find item below node: > Assign[targets=[Name[id=this, ctx=Store, reserved=false]], value=null] > (module: __init__.py). > at org.python.pydev.core.log.Log.log(Log.java:54) > at > > org.python.pydev.parser.fastparser.FastDefinitionsParser.endScopesInStack(FastDefinitionsParser.java:589) > at > > org.python.pydev.parser.fastparser.FastDefinitionsParser.handleNewLine(FastDefinitionsParser.java:380) > at > > org.python.pydev.parser.fastparser.FastDefinitionsParser.extractBody(FastDefinitionsParser.java:249) > at > > org.python.pydev.parser.fastparser.FastDefinitionsParser.parse(FastDefinitionsParser.java:676) > at > > com.python.pydev.analysis.additionalinfo.AbstractAdditionalTokensInfo.addAstInfo(AbstractAdditionalTokensInfo.java:310) > at > > com.python.pydev.analysis.additionalinfo.AbstractAdditionalInfoWithBuild.restoreInfoForModuleManager(AbstractAdditionalInfoWithBuild.java:258) > at > > com.python.pydev.analysis.additionalinfo.AdditionalSystemInterpreterInfo.recreateAllInfo(AdditionalSystemInterpreterInfo.java:179) > at > > com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver.notifyDefaultPythonpathRestored(InterpreterObserver.java:35) > at > > org.python.pydev.ui.interpreters.AbstractInterpreterManager.restorePythopathForInterpreters(AbstractInterpreterManager.java:726) > at > > org.python.pydev.ui.interpreters.AbstractInterpreterManager.setInfos(AbstractInterpreterManager.java:643) > at > > gov.midas.ide.ui.MidasActivator.configurePydevPredfinedCompletion(MidasActivator.java:339) > at gov.midas.ide.ui.MidasActivator.start(MidasActivator.java:109) > at > > org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) > at > > org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) > at java.security.AccessController.doPrivileged(Native Method) > at > > org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) > at > > org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721) > at > > org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941) > at > > org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318) > at org.eclipse.osgi.container.Module.doStart(Module.java:571) > at org.eclipse.osgi.container.Module.start(Module.java:439) > at > > org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) > at > > org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562) > at > > org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) > at > > org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) > at > > org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) > at > > org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) > at > > org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Mark L. <mid...@ve...> - 2016-01-19 16:47:50
|
My RCP app was using http://pydev.org/updates for PyDev, which was upgraded yesterday (I think) from PyDev 4.4 to 4.5. I'm using 4.4 now after switching to https://dl.bintray.com/fabioz/pydev/all/, but I'd like to run with 4.5, and I have a problem with it. When I launch the app, the console gets flooded with numerous instances of the stack trace below. The line of my code that leads to the exception (MidasActivator line 339) is this IInterpreterManager manager = ... manager.setInfos(new IInterpreterInfo[] {xmpyInterp}, null, new NullProgressMonitor()); I'm updating the python interpreter there after adding a pypredef location. This doesn't happen in PyDev 4.4. Also it doesn't happen in PyDev 4.5 if I omit the com.python.pydev plug-ins from my product (specifically com.python.pydev.analysis). In that case, I get an NPE when PyDev checks if the interpreters are synced with the environment. I can prevent that exception my implementing a contribution to extension org.python.pydev.pydev_interpreter_info_builder which does nothing. So I don't know if I've got something in my code that is incompatible with PyDev 4.5, or is implementing an info builder extension that does nothing the expected pattern? I would think that including the com.python.pydev plug-ins is expected, in whch case I need to figure out why I get exceptions when I do. !ENTRY org.python.pydev.shared_core 4 4 2016-01-19 11:24:53.650 !MESSAGE Did not expect to find item below node: Assign[targets=[Name[id=this, ctx=Store, reserved=false]], value=null] (module: __init__.py). !STACK 0 java.lang.RuntimeException: Did not expect to find item below node: Assign[targets=[Name[id=this, ctx=Store, reserved=false]], value=null] (module: __init__.py). at org.python.pydev.core.log.Log.log(Log.java:54) at org.python.pydev.parser.fastparser.FastDefinitionsParser.endScopesInStack(FastDefinitionsParser.java:589) at org.python.pydev.parser.fastparser.FastDefinitionsParser.handleNewLine(FastDefinitionsParser.java:380) at org.python.pydev.parser.fastparser.FastDefinitionsParser.extractBody(FastDefinitionsParser.java:249) at org.python.pydev.parser.fastparser.FastDefinitionsParser.parse(FastDefinitionsParser.java:676) at com.python.pydev.analysis.additionalinfo.AbstractAdditionalTokensInfo.addAstInfo(AbstractAdditionalTokensInfo.java:310) at com.python.pydev.analysis.additionalinfo.AbstractAdditionalInfoWithBuild.restoreInfoForModuleManager(AbstractAdditionalInfoWithBuild.java:258) at com.python.pydev.analysis.additionalinfo.AdditionalSystemInterpreterInfo.recreateAllInfo(AdditionalSystemInterpreterInfo.java:179) at com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver.notifyDefaultPythonpathRestored(InterpreterObserver.java:35) at org.python.pydev.ui.interpreters.AbstractInterpreterManager.restorePythopathForInterpreters(AbstractInterpreterManager.java:726) at org.python.pydev.ui.interpreters.AbstractInterpreterManager.setInfos(AbstractInterpreterManager.java:643) at gov.midas.ide.ui.MidasActivator.configurePydevPredfinedCompletion(MidasActivator.java:339) at gov.midas.ide.ui.MidasActivator.start(MidasActivator.java:109) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318) at org.eclipse.osgi.container.Module.doStart(Module.java:571) at org.eclipse.osgi.container.Module.start(Module.java:439) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) |
From: Fabio Z. <fa...@gm...> - 2016-01-14 15:53:10
|
Release Highlights: ------------------------------- * Debugger * Cython speedup modules are now available for the debugger (see performance improvements at: https://www.speedtin.com/reports/7_pydevd_cython). * It is considerably faster even without the speedup modules (see performance improvements at: https://www.speedtin.com/reports/8_pydevd_pure_python). * When debugging multiple processes the console wasn't being updated to the selected stack in the debug view. * Many bug-fixes. * Improved the search to always play safe and update the index so that the matches are always consistent (#PyDev-634). * Fixed issue renaming top-level module on refactoring. * Refactoring has option to rename variable to a standard case style. * Improved the parser that extracted the outline for global tokens to deal with async and consider declarations inside ifs. * Code completion of properties with @property no longer shows arguments parenthesis (#PyDev-453). * Preventing a freeze if some code-analysis takes too much time (#PyDev-636). * Ctrl+1 can be used to wrap/unwrap the contents of brackets (patch by yohell). What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Luca G. <luc...@gm...> - 2015-11-30 15:49:49
|
In the past 1.5 year I have developed a quite big code using Python 2.7.8 (Anaconda accelerate) and Tkinter with quite some satisfaction. I have being using Eclipse Luna + Pydev and everything was running smooth, moreover I would say that I was really impressed by the overall performance. Then some time ago I have performed the Pydev update to version 4.4.0, since then the debugger stacks and bug consistently. I'll try to be more specific: in my code a main window open a second window that runs a chunk of code using threading python library (in order to still have the window active); now when I debug this portion of the code a strange small TK window appears and the debugger bugs. I have tried to upgrade to Eclipse Mars but I get the same error.... I’m pretty sure that the problem is in Pydev 4.4.0 since I have downgraded to version 4.3.0 (using Eclipse Mars) and everything is working again!!!!! Thanks in advance for the support Luca |
From: Marek J. <mar...@gm...> - 2015-11-08 19:12:20
|
Thanks Fabio, It works excellent! I will let you know when I will be releasing a new version with python support. Thank you for your great work you are doing with PyDev. Marek 2015-11-08 10:19 GMT+01:00 Fabio Zadrozny <fa...@gm...>: > Hi Marek, > > Yes, there's code to do that... The idea is that you get the AST for a > module and then work in the AST (usually through a visitor) to get the > information you want (the AdditionalInfoAndIInfo isn't the actual API you > want for that... what it gives is a global view of module names and tokens, > but it has only the names and path... when you want to do some analysis you > need the full AST). > > It goes something like: > > > PythonNature nature = PythonNature.getPythonNature(project); > IResource resource = null; > if(nature != null){ > IModulesManager modulesManager = > nature.getAstManager().getModulesManager(); > String moduleName = nature.resolveModule(resource); > if(moduleName != null){ > IModule module = modulesManager.getModule(moduleName, > nature, true); > if(module != null){ > if(module instanceof SourceModule){ > SourceModule sourceModule = (SourceModule) module; > SimpleNode ast = sourceModule.getAst(); > EasyASTIteratorVisitor visitor = > EasyASTIteratorVisitor.create(ast); > Iterator<ASTEntry> it = > visitor.getClassesAndMethodsIterator(); > while(it.hasNext()){ > ASTEntry entry = it.next(); > if(entry.node instanceof ClassDef){ > ClassDef classDef = (ClassDef) entry.node; > // Check classDef.decs for decorators > > }else if(entry.node instanceof FunctionDef){ > FunctionDef functionDef = (FunctionDef) > entry.node; > // Check functionDef.body for assignments > to InputPort/OutputPort > // if functionDef.name == __init_ports__ > } > } > } > } > } > } > > > > On Sat, Nov 7, 2015 at 11:02 PM, Marek Jagielski < > mar...@gm...> wrote: > >> Hi, >> I develop an eclipse environment for workflow engine: >> http://systemincloud.com/. I am integrating python into it, now. >> I force a dependency of PyDev for my plugin to reuse as much as possible >> what gives already PyDev. >> >> I would like to know if in PyDev there is a code that I can reuse to >> analyse a python class. >> I already able to find module: >> >> IProject p = >> ResourcesPlugin.getWorkspace().getRoot().getProject(EclipseUtil.getProjectNameFromDiagram(getDiagram())); >> AdditionalInfoAndIInfo pinfo = FindPythonTask.INSTANCE.find(p, className); >> >> FindPythonTask is based on based on GlobalsTwoPanelElementSelector2. >> Python Module looks like this: >> >> from sicpythontask.PythonTaskInfo import PythonTaskInfo >> from sicpythontask.PythonTask import PythonTask >> from sicpythontask.InputPort import InputPort >> from sicpythontask.OutputPort import OutputPort >> from sicpythontask.data.Bool import Bool >> >> @PythonTaskInfo >> class MyPythonTask(PythonTask): >> >> def __init_ports__(self): >> self.ttt = InputPort(name="ttt", data_type=Bool) >> self.yyy = OutputPort(name="yyy", data_type=Bool) >> >> def execute(self, grp): >> """ this will run when all synchronous ports >> from group receive data """ >> >> I would like now: >> 1. check if there is decorator @PythonTaskInfo and read eventual >> attributes. >> 2. from method __init_ports__ list all InputPort and OutputPort with >> their attributes >> >> Is it possible with PyDev api to do what I need? Do you do such an >> analyse in PyDev? Where can I find any example of code analyse? >> >> To note. For Java analyseI use org.eclipse.jdt.internal.core.NamedMember. >> >> Thanks for any help and hint, >> >> Marek Jagielski >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> >> > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > -- Marek Jagielski +48 513 402 596 |
From: Fabio Z. <fa...@gm...> - 2015-11-08 09:20:25
|
Hi Marek, Yes, there's code to do that... The idea is that you get the AST for a module and then work in the AST (usually through a visitor) to get the information you want (the AdditionalInfoAndIInfo isn't the actual API you want for that... what it gives is a global view of module names and tokens, but it has only the names and path... when you want to do some analysis you need the full AST). It goes something like: PythonNature nature = PythonNature.getPythonNature(project); IResource resource = null; if(nature != null){ IModulesManager modulesManager = nature.getAstManager().getModulesManager(); String moduleName = nature.resolveModule(resource); if(moduleName != null){ IModule module = modulesManager.getModule(moduleName, nature, true); if(module != null){ if(module instanceof SourceModule){ SourceModule sourceModule = (SourceModule) module; SimpleNode ast = sourceModule.getAst(); EasyASTIteratorVisitor visitor = EasyASTIteratorVisitor.create(ast); Iterator<ASTEntry> it = visitor.getClassesAndMethodsIterator(); while(it.hasNext()){ ASTEntry entry = it.next(); if(entry.node instanceof ClassDef){ ClassDef classDef = (ClassDef) entry.node; // Check classDef.decs for decorators }else if(entry.node instanceof FunctionDef){ FunctionDef functionDef = (FunctionDef) entry.node; // Check functionDef.body for assignments to InputPort/OutputPort // if functionDef.name == __init_ports__ } } } } } } On Sat, Nov 7, 2015 at 11:02 PM, Marek Jagielski <mar...@gm...> wrote: > Hi, > I develop an eclipse environment for workflow engine: > http://systemincloud.com/. I am integrating python into it, now. > I force a dependency of PyDev for my plugin to reuse as much as possible > what gives already PyDev. > > I would like to know if in PyDev there is a code that I can reuse to > analyse a python class. > I already able to find module: > > IProject p = > ResourcesPlugin.getWorkspace().getRoot().getProject(EclipseUtil.getProjectNameFromDiagram(getDiagram())); > AdditionalInfoAndIInfo pinfo = FindPythonTask.INSTANCE.find(p, className); > > FindPythonTask is based on based on GlobalsTwoPanelElementSelector2. > Python Module looks like this: > > from sicpythontask.PythonTaskInfo import PythonTaskInfo > from sicpythontask.PythonTask import PythonTask > from sicpythontask.InputPort import InputPort > from sicpythontask.OutputPort import OutputPort > from sicpythontask.data.Bool import Bool > > @PythonTaskInfo > class MyPythonTask(PythonTask): > > def __init_ports__(self): > self.ttt = InputPort(name="ttt", data_type=Bool) > self.yyy = OutputPort(name="yyy", data_type=Bool) > > def execute(self, grp): > """ this will run when all synchronous ports > from group receive data """ > > I would like now: > 1. check if there is decorator @PythonTaskInfo and read eventual > attributes. > 2. from method __init_ports__ list all InputPort and OutputPort with > their attributes > > Is it possible with PyDev api to do what I need? Do you do such an > analyse in PyDev? Where can I find any example of code analyse? > > To note. For Java analyseI use org.eclipse.jdt.internal.core.NamedMember. > > Thanks for any help and hint, > > Marek Jagielski > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > |
From: Marek J. <mar...@gm...> - 2015-11-08 01:02:52
|
Hi, I develop an eclipse environment for workflow engine: http://systemincloud.com/. I am integrating python into it, now. I force a dependency of PyDev for my plugin to reuse as much as possible what gives already PyDev. I would like to know if in PyDev there is a code that I can reuse to analyse a python class. I already able to find module: IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(EclipseUtil.getProjectNameFromDiagram(getDiagram())); AdditionalInfoAndIInfo pinfo = FindPythonTask.INSTANCE.find(p, className); FindPythonTask is based on based on GlobalsTwoPanelElementSelector2. Python Module looks like this: from sicpythontask.PythonTaskInfo import PythonTaskInfo from sicpythontask.PythonTask import PythonTask from sicpythontask.InputPort import InputPort from sicpythontask.OutputPort import OutputPort from sicpythontask.data.Bool import Bool @PythonTaskInfo class MyPythonTask(PythonTask): def __init_ports__(self): self.ttt = InputPort(name="ttt", data_type=Bool) self.yyy = OutputPort(name="yyy", data_type=Bool) def execute(self, grp): """ this will run when all synchronous ports from group receive data """ I would like now: 1. check if there is decorator @PythonTaskInfo and read eventual attributes. 2. from method __init_ports__ list all InputPort and OutputPort with their attributes Is it possible with PyDev api to do what I need? Do you do such an analyse in PyDev? Where can I find any example of code analyse? To note. For Java analyseI use org.eclipse.jdt.internal.core.NamedMember. Thanks for any help and hint, Marek Jagielski |
From: Fabio Z. <fa...@gm...> - 2015-10-06 12:00:08
|
Release Highlights: ------------------------------- * Improved PyDev Package Explorer to give more information when all elements are filtered. * Code completion improvements: when a parameter is typed in the docstring, assigning it to an instance gives proper code-completion results when accessing the instance. * Fixed issues dealing with ansi colors in the interactive console. * When autopep8 is applied as the code formatting engine, the region selected is used to specify the lines for formatting. * Minor improvements in the debugger. What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Jonah G. <jo...@ki...> - 2015-09-11 13:12:48
|
Hi all, For those of you within striking distance of London, I want to invite you to 'Eclipse Night London' which Kichwa Coders is helping organize and is next Wednesday, the 16th of September. It is a general Eclipse event with a variety of talks and a keynote from Mike Milinkovich, the Executive Director of the Eclipse Foundation. There will be quite a few people who work with PyDev, along with developers who have worked on PyDev and integrated it into their project. More details can be found here: http://www.meetup.com/London-Eclipse-User-Group/events/224585853/ I hope you can make it, Jonah ~~~ Jonah Graham Kichwa Coders Ltd. www.kichwacoders.com |
From: <Dir...@de...> - 2015-08-20 20:20:36
|
Dirk Volkmar will be out of the office starting 07/08/2015 and will be returning on 25/08/2015. ------------------------------------------------------------------------- Deutsche Börse AG Chairman of the Supervisory Board/ Vorsitzender des Aufsichtsrats: Dr. Joachim Faber Executive Board/Vorstand: Carsten Kengeter, (Chief Executive Officer/Vorsitzender), Andreas Preuss (Deputy Chief Executive Officer/ stellv. Vorsitzender), Gregor Pottmeyer, Hauke Stars, Jeffrey Tessler. Aktiengesellschaft with registered seat in/mit Sitz in Frankfurt am Main. Commercial register/Handelsregister: HRB 32232 Local court/Amtsgericht Frankfurt am Main. ----------------------------------------- Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen. Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet. The information contained in this message is confidential or protected by law. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorised copying of this message or unauthorised distribution of the information contained herein is prohibited. Legally required information for business correspondence/ Gesetzliche Pflichtangaben fuer Geschaeftskorrespondenz: http://deutsche-boerse.com/letterhead |
From: Fabio Z. <fa...@gm...> - 2015-08-20 18:23:17
|
Release Highlights: ------------------------------- * Fixed parser for Python 3.x to support async and await as regular names too (PyDev-593). * The new search dialog now has a 'whole word' option which automatically adds `*` to the search * Search backend updated to Lucene 5.2.1 (instant searches on huge codebases) * When bringing up the search dialog the search text is initially selected. What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Fabio Z. <fa...@gm...> - 2015-07-07 19:49:33
|
Release Highlights: ------------------------------- * New search page for Python contents * Text-searches using a Lucene index allows for fast matches. * Matches can be flattened and grouped by project, folders and modules. * Results page allows additional filtering based on module name. * Further improvements on code completion unpacking compound types. * Not adding auto 'import' token in cython files (to accept cimport). * PyDev Mylyn integration no longer depends on a specific PyDev release. * Fixed halting condition when unable to create native file watches. * Vertical indent guide no longer slows down the editor on Linux (PyDev-582). What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Fabio Z. <fa...@gm...> - 2015-06-17 19:20:09
|
On Thu, Jun 11, 2015 at 7:43 AM, Jonah Graham < jo...@ki...> wrote: > Hi Fabio, > > The latest release (4.1.0) does not appear to have jars signed. I don't > mind if they are signed or not, but I was concerned because it was a > change. Are the 4.1.0 jars on the update site the correct ones? > > Jonah > > Hi Jonah, I just checked and the binaries were really generated without the proper signature (the jars on the update site are correct). This happened because I moved the keystore but failed to update the related environment variable in the build (and the build just completed without complaining about it). I'll make sure that the next release will have that fixed. Best Regards, Fabio |
From: Jonah G. <jo...@ki...> - 2015-06-11 11:00:13
|
Hi Fabio, The latest release (4.1.0) does not appear to have jars signed. I don't mind if they are signed or not, but I was concerned because it was a change. Are the 4.1.0 jars on the update site the correct ones? Jonah On 27 May 2015 at 02:48, Fabio Zadrozny <fa...@gm...> wrote: > What is PyDev? > --------------------------- > > PyDev is an open-source Python IDE on top of Eclipse for Python, Jython > and IronPython development. > > It comes with goodies such as code completion, syntax highlighting, syntax > analysis, code analysis, refactor, debug, interactive console, etc. > > Details on PyDev: http://pydev.org > Details on its development: http://pydev.blogspot.com > > > What is LiClipse? > --------------------------- > > LiClipse is a PyDev standalone with goodies such as support for Multiple > cursors, theming, TextMate bundles and a number of other languages such as > Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, > etc. > > It's also a commercial counterpart which helps supporting the development > of PyDev. > > Details on LiClipse: http://www.liclipse.com/ > > > Release Highlights: > ------------------------------- > > * **Code Completion** > > * Improved unpacking of compound types on more situations (PyDev-573). > > * **Debugger** > > * PyDev remote debugging no longer blocks running program to completion > (PyDev-574). > * When there are too many referrers to some object, results are trimmed. > > * **Python 3 grammar** > > * Accepting **@** as matrix multiplication operator. > * **async** and **await** are properly parsed. > * Fixed issue parsing 'list remainder' construct (PyDev-568). > * **Others** > > * Fixed issue showing editor title name when more than one dot was present > in the filename. > * Support automatic folding elements when opening a file -- must be > enabled in PyDev > Editor > Code Folding (patch by Andreas Pakulat). > * Fixed issue on search page. > * Included css to set default editor colors for PyDev for in Eclipse dark > theme. > * Tab-stops on comments added and enabled by default (patch by jheiv). > * Fixed StackOverflowError on code-completion (PyDev-570) > > > Cheers, > > -- > Fabio Zadrozny > ------------------------------------------------------ > Software Developer > > LiClipse > http://www.liclipse.com > > PyDev - Python Development Environment for Eclipse > http://pydev.org > http://pydev.blogspot.com > > PyVmMonitor - Python Profiler > http://www.pyvmmonitor.com/ > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > |
From: Fabio Z. <fa...@gm...> - 2015-05-27 01:49:22
|
What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Release Highlights: ------------------------------- * **Code Completion** * Improved unpacking of compound types on more situations (PyDev-573). * **Debugger** * PyDev remote debugging no longer blocks running program to completion (PyDev-574). * When there are too many referrers to some object, results are trimmed. * **Python 3 grammar** * Accepting **@** as matrix multiplication operator. * **async** and **await** are properly parsed. * Fixed issue parsing 'list remainder' construct (PyDev-568). * **Others** * Fixed issue showing editor title name when more than one dot was present in the filename. * Support automatic folding elements when opening a file -- must be enabled in PyDev > Editor > Code Folding (patch by Andreas Pakulat). * Fixed issue on search page. * Included css to set default editor colors for PyDev for in Eclipse dark theme. * Tab-stops on comments added and enabled by default (patch by jheiv). * Fixed StackOverflowError on code-completion (PyDev-570) Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Fabio Z. <fa...@gm...> - 2015-04-15 12:16:14
|
What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Release Highlights: ------------------------------- * **Code Completion** * PyDev can now code-complete unpacking compound types (such as list(str), tuple(MyClass), dict(int:str), etc). * Code-completion now has a maximum amount of time to complete (which may be changed in the code-completion preferences). * **Editor** * Bytes and Unicode literals now have different colors (note: by default the Unicode kept the same color used for the old 'Strings' configuration). * Mark occurrences is now also provided on some statements (such as return, continue, etc). * **PyVmMonitor** * The PyVmMonitor integration was improved on finding the PyVmMonitor executable on Linux and Mac. * **Others** * It's now possible to bind custom keybindings to help in passing custom commands to the interactive console (see: PyDev > Interactive Console > User Commands) * The bundled autopep8.py and pep8.py were upgraded. * Search for references (Ctrl+Shift+G) is faster (all processors available are used for the initial search). * Search page now has a 'whole word' option. * Fixed PyDev-Mylyn integration in the PyDev Package Explorer to work with the latest Mylyn. * Fixed issue doing code-completion for elements of a list (lst[0].) in the console. (PyDev-531) * py.test xfailed tests are no longer marked as 'Failed' in PyUnit view (PyDev-506) Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipsehttp://www.liclipse.com PyDev - Python Development Environment for Eclipsehttp://pydev.orghttp://pydev.blogspot.com PyVmMonitor - Python Profilerhttp://www.pyvmmonitor.com/ |
From: Fabio Z. <fa...@gm...> - 2015-04-13 22:57:19
|
Hi Andreas, I think that if you just mark collapsed on the first time that the CodeFoldingSetter sets the annotations that should work... on new runs it should only recreate the annotations that were actually added. I.e.: in org.python.pydev.editor.codefolding.CodeFoldingSetter.getAnnotationsToAdd(List<FoldingEntry>, ProjectionAnnotationModel, List<PyProjectionAnnotation>) the 'existing' parameter has the annotations that exist and should be removed (so the annotations that should not be changed should be removed from that list). Cheers, Fabio On Fri, Apr 10, 2015 at 6:43 AM, Andreas Pakulat <an...@fr...> wrote: > Hi, > > I've tried to add a new option for code-folding that allows PyDev to > automatically fold comments when initially opening the editor. We'd like to > have that in our IDE for the Python scripts. > > Unfortunately just passing isCollapsed=true to ProjectAnnotation when a > corresponding preference is enabled means that the comments are also > collapsed whenever the user saves the file. Thats undesirable and I'm > currently wondering what the best way would be to tell the > CodeFoldingSetter > class wether it should apply the initially-collapsed setting or not when > setting up the annotations? > > I guess one option would be to avoid re-creating the annotations, so that > the > editor framework would take care of that, but I'm not sure how to go about > that either - could I compare the ASTEntry's that the annotations keep? > Would > they be equal or have some comparable properties between runs? > > Andreas > > -- > Andreas Pakulat sq...@fr... > froglogic GmbH - Automated UI and Web Testing > > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live > exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- > event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Andreas P. <an...@fr...> - 2015-04-10 09:44:05
|
Hi, I've tried to add a new option for code-folding that allows PyDev to automatically fold comments when initially opening the editor. We'd like to have that in our IDE for the Python scripts. Unfortunately just passing isCollapsed=true to ProjectAnnotation when a corresponding preference is enabled means that the comments are also collapsed whenever the user saves the file. Thats undesirable and I'm currently wondering what the best way would be to tell the CodeFoldingSetter class wether it should apply the initially-collapsed setting or not when setting up the annotations? I guess one option would be to avoid re-creating the annotations, so that the editor framework would take care of that, but I'm not sure how to go about that either - could I compare the ASTEntry's that the annotations keep? Would they be equal or have some comparable properties between runs? Andreas -- Andreas Pakulat sq...@fr... froglogic GmbH - Automated UI and Web Testing |