#1730 JavaSideKick "Imports" Asset not foldable sometimes if there are blank lines between imports?

None
closed-fixed
Dale Anson
None
5
2014-04-08
2013-08-15
Alan Ezust
No

It should be so the imports can be folded like the other assets.

1 Attachments

Discussion

  • Dale Anson
    Dale Anson
    2013-11-11

    Works for me. Do you have a specific file this isn't working with?

     
  • Alan Ezust
    Alan Ezust
    2013-11-22

    I guess for some Java files it works, but for others it doesn't.
    One example where it does not work is in fastopen plugin, the FastOpenPlugin.java
    When I parse it, sometimes I only see one import in the sidekick tree, other times I see all of the imports.
    But regardless, the imports section is not foldable.

     
  • Dale Anson
    Dale Anson
    2014-03-31

    Tested with JavaSideKick 3.1.5, SideKick 1.4, jEdit 5.2pre1, and FastOpenPlugin.java and it works fine. Any other file you're seeing this doesn't work with?

     
  • Dale Anson
    Dale Anson
    2014-03-31

    Actually, I see that 3.1.5 was released about a year and a half ago and there are some decent changes since then. Are you using the release version or did you build it from trunk?

     
  • Alan Ezust
    Alan Ezust
    2014-04-02

    For another example, try GUIUtilities.java from jEdit's source, however, you have to modify the buffer-local properties at the top from folding=explicit to folding=sidekick to see the problem.

     
    Last edit: Alan Ezust 2014-04-02
  • Alan Ezust
    Alan Ezust
    2014-04-02

    After updating to the latest trunk of JavaSideKick, my original example where i saw the problem in FastOpenPlugin.java, it seems to be fixed now. So I am not sure why GUIUtilities still has problems but FastOpen.java imports fold fine now.

     
    Last edit: Alan Ezust 2014-04-02
  • Dale Anson
    Dale Anson
    2014-04-02

    I'm not sure either. GUIUtilities.java works fine for me too.

     
  • Alan Ezust
    Alan Ezust
    2014-04-02

    For you, does it really fold all imports from lines 25-71?
    For me, I get 4 different folding regions!!
    Screenshot attached.

     
  • Dale Anson
    Dale Anson
    2014-04-03

    Oh, you're talking about the folding in the text area, right? I also have 4 different folding regions, but not that's part of JavaSideKick, it's part of SideKick itself. JavaSideKick doesn't provide a fold handler of it own, maybe it should?

     
  • Dale Anson
    Dale Anson
    2014-04-08

    • status: open --> closed-fixed
     
  • Dale Anson
    Dale Anson
    2014-04-08

    Fixed in revision 23467. Part of the fix is in SideKick, part is in JavaSideKick. Due to the way imports are handled, I did end up adding a fold handler in JavaSideKick. One thing I noticed is that if you add lines in the imports area of a file, there may be extra folds created until the file is reparsed. Setting SideKick to parse on keystroke eliminates that problem.