Author Topic: Basic beautifier?  (Read 12680 times)

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Basic beautifier?
« 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.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2831
  • Hero Points: 429
Re: Basic beautifier?
« Reply #1 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

jkwuc89

  • Senior Community Member
  • Posts: 199
  • Hero Points: 6
Re: Basic beautifier?
« Reply #2 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.

Dan112123

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Basic beautifier?
« Reply #3 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  ???

 

hs2

  • Senior Community Member
  • Posts: 2738
  • Hero Points: 288
Re: Basic beautifier?
« Reply #4 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

Dan112123

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Basic beautifier?
« Reply #5 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.

hs2

  • Senior Community Member
  • Posts: 2738
  • Hero Points: 288
Re: Basic beautifier?
« Reply #6 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