Code Folding for custom languages/indent-based languages

General Discussion on RSyntaxTextArea.

Moderator: robert

Code Folding for custom languages/indent-based languages

Postby Frotty » Sun Dec 25, 2011 2:44 pm

Hi,
As I stated in a comment allready, I am using RSTA for a small IDE for a small own scripting language which is indention based.
So will Code Folding be available for custom languages some day or only for the ones you implement?
Frotty
 

Re: Code Folding for custom languages/indent-based languages

Postby robert » Sun Dec 25, 2011 8:24 pm

I'd love to have code folding for other languages. I was going to do Python, which would be indentation-based like yours, but I'm putting that off for now since I don't actually use Python. If your language is close enough to Python then perhaps we could push this through sooner...
User avatar
robert
 
Posts: 797
Joined: Sat May 10, 2008 5:16 pm

Re: Code Folding for custom languages/indent-based languages

Postby Frotty » Fri Dec 30, 2011 6:21 pm

Well it uses indentation to define all blocks other than packages. (package/endpackage)
I'm not really using code folding that much, but some End-users I know have a hrad need for it, so it would be kind of a nice feature.
Frotty
 

Re: Code Folding for custom languages/indent-based languages

Postby robert » Sat Dec 31, 2011 3:51 am

Okay, I'll try to cobble up a generic indentation-based fold parser; it'll be used by Python but you can configure it to be used by your own language as well. Any language-specific items (such as package/endpackage as you mentioned) can hopefully be handled by some sort of generic option, or worst-case by subclassing the IndentationBasedFoldParser class to add a little extra logic.

Sound good? If so just send me your email and I can notify you when there's something to try out, otherwise you can just watch this forum and/or the blog.

You sound like me - don't care about code folding personally, but just want it for your end users. :D
User avatar
robert
 
Posts: 797
Joined: Sat May 10, 2008 5:16 pm

Re: Code Folding for custom languages/indent-based languages

Postby FrottyZ » Sat Dec 31, 2011 4:23 pm

Sure, you can send me and email I created an account 2 hours ago, but somehow I don't receive the activation email.
So its -> frotty at sunayama . de

I am watching the blog, but it very rarely gets any entry :)

Sounds good by the way ;)
FrottyZ
 

Re: Code Folding for custom languages/indent-based languages

Postby robert » Tue Jan 03, 2012 3:38 am

After looking at some discussions about Python folding, and trying to reverse engineer what Notepad++ does, I'm hesitant to build an indentation-based fold parser for it on my own. There seem to be nuances (to Python at least) and I'd be much happier if somebody who knew Python could review the work and made sure it worked as expected. Least-common denominator of course; it doesn't have to handle *all* possible cases, as long as it doesn't ever get confused or *incorrectly* identify foldable regions that shouldn't be foldable...
User avatar
robert
 
Posts: 797
Joined: Sat May 10, 2008 5:16 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron