SlickEdit Community

General => General Programming => Topic started by: Wanderer on September 22, 2006, 11:11:24 am

Title: Basic beautifier?
Post by: Wanderer on September 22, 2006, 11:11:24 am
Hello,
Does anyone know of a free/cheap code beautifier for bas/vb?
(It would be nice if SlickEdit had one built in...)
Thanks.
Title: Re: Basic beautifier?
Post by: Dennis on September 30, 2006, 03:21:08 am
We've had a lot of requests for beautifers for other languages, especially Perl, for some reason.

// begin funny macro -- sense of humor required
//
_command void basic_or_perl_or_ruby_beautifier()
{
    select_all();
    delete_selection();
    select_mode("c");
}
// end funny macro

OK, now, seriously, we have a feature request filed for a "generic" beautifier that does simple stupid things like re-indenting each line (as if you used tab to re-indent), stripping trailing whitespace, replacing leading whitespace with user specified preferences (real tabs vs. spaces), and respacing around operators, parens, and commas.

This sort of beautifier couldn't ever re-arrange code, for example brace styles, but it could as least get you to "not ugly".  The feature didn't make the cut for our next revision, but maybe this is a great opportunity for a forum user to step up and write a really useful macro that does these things.  Good starting point:  filter_selection().

Finally, GNU indent may have a lexer for VB, depending on what generation of Basic you are talking about.

--Dennis
Title: Re: Basic beautifier?
Post by: jkwuc89 on March 04, 2008, 04:36:33 pm
I think a generic beautifier that handles what you describe would be an excellent feature to add to SlickEdit 2008.
Title: Re: Basic beautifier?
Post by: Dan112123 on July 21, 2008, 11:18:58 pm

OK, now, seriously, we have a feature request filed for a "generic" beautifier that does simple stupid things like re-indenting each line (as if you used tab to re-indent), stripping trailing whitespace, replacing leading whitespace with user specified preferences (real tabs vs. spaces), and respacing around operators, parens, and commas.
--Dennis


I'm using SE v13 and trying to create a generic beautifier that would format AutoHotKey scripts. All I'm looking for is to change indents. It's been 2 years since your post and 2 releases later. Did this feature make it in? For some reason I can't find it  ???

 
Title: Re: Basic beautifier?
Post by: hs2 on July 22, 2008, 12:33:12 am
Hi Dan112123. did you add any AHK support to SE ? Lexer, basic tagging ?
If yes it would be great if you could share it ! It's still on my (long term) todo list ...
TIA, HS2
Title: Re: Basic beautifier?
Post by: Dan112123 on August 01, 2008, 05:00:50 am
Hi Dan112123. did you add any AHK support to SE ? Lexer, basic tagging ?
If yes it would be great if you could share it ! It's still on my (long term) todo list ...
TIA, HS2


Yes I've added some stuff, like syntax highlighting, but no autocomplete yet. It's a lot of work and I just don't have the time to spare right now.
Title: Re: Basic beautifier?
Post by: hs2 on August 01, 2008, 08:10:51 am
Great - could you please post the [ahk] part of your <config-dir>\user.vlx ?
Even the lexer stuff would be very helpful. I afraid tagging support is not so easy to add due to the quite 'relaxed' syntax.

HS2