Source code "beautifier" feature

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jcramer
Posts: 3
Joined: Tue Mar 08, 2005 11:40 pm

Source code "beautifier" feature

Post by jcramer »

-A tool to "beautify" text if it is source code for a programming language would be very useful. The beautifier would left justify lines of code in a programming block, indent to right the lines within a block, with the amount of indentation dependent upon the amount of nesting of the program block. This is tough because of all of the programming languages out there with different block syntax. There would need to be some sort of configuration file for the block definitions (ex: IF-THEN-ELSE ) that would be language dependent.

Also, it would be nice to have the +/- widget to the left of the 1st line of each programming block which expands and collapses the code in a given block. I have seen this in a text editor called "Katie" which is the standard editor for the KDE desktop on Linux.

These 2 features would really help make the readibility of long, heavily nested program source files more readable, cut down on programming errors and speed up development.
Jim Cramer
Data Base Developer/Admin
University of Iowa
College of Engineering
User avatar
nyugi
Posts: 21
Joined: Mon Jun 16, 2003 7:52 am
Location: Kecskemét, Hungary

Post by nyugi »

You mean, there could be an option of specifying code format definition files like there are the syntax definition files for every document class?
Or maybe some kind of structured syntax definition file could define either the syntax highlight and the code formatting rules.
That could even help supporting the folding (+/-) and the function finding features.
jcramer
Posts: 3
Joined: Tue Mar 08, 2005 11:40 pm

Post by jcramer »

Yes, this is what I mean. Either a separate code format definition file for each language, in addition to the syntax definition file, or else enhance the functiionality of the syntax definiton files to add a section which defines the keywords that start and end the various programming constructs and blocks of the particular language.

And yes that could be used to define the folding (+/-) levels.
Jim Cramer
Data Base Developer/Admin
University of Iowa
College of Engineering
User avatar
talleyrand
Posts: 625
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

As always, I'm too lazy to look but if you check this forum for code folding, you should find the enhancement request for the +/- thing.

The Souce Code beautifier sounds tricky as a built in feature. Not that I wouldn't love to have one to run against some of the legacy stuff I see but my thought would be to use an outside tool to handle that. I know they exist for java and sql (although the one I found was only PL/SQL and expensive at that). I had started down the path of understanding yacc, flex, bison etc to try to write a beautifier (because you have to be able to parse i,t to beautify it) but got bogged down and never went anywhere with it.
I choose to fight with a sack of angry cats.
Post Reply