Replace spaces with tabs in literal strings?

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Replace spaces with tabs in literal strings?

Postby bpieber » Sat Dec 15, 2007 5:15 am

By default VA Smalltalk seems to replace spaces with tabs at the start of a line in a code browser. This even happens if it is in a literal string. This seems like a bug to me. What do others think?

A workaround is to turn the replacement off completely. I use the following statement to accomplish that:
EmImageSupport sourceFilter leaveTabsAlone

Wouldn't this be a better default setting anyway?

Cheers,
Bernhard
bpieber
 
Posts: 27
Joined: Sat Nov 04, 2006 4:00 am

Postby tc » Sun Dec 16, 2007 7:11 am

Hello,

I can't say if it is a better default setting to have, however, it seems like it might be worth adding to a menu in a class browser, under 'Options', or the options window that one can open from the Transcript.

One of the nice things about the ST environment (and Envy) is it comes configured a certain way but each user can change the 'environmental' settings to get it to behave the way they like/want it.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Postby bpieber » Sun Dec 16, 2007 8:21 am

Yes, the possibility to adapt the environment is a big advantage. Sometimes it is quite difficult to find the right place for a change, though.

Having thought a little bit about it, I think this feature - converting spaces to tabs - should be replaced by a more general "format on save" like in Eclipse 3.3. The spaces/tabs conversion could be one of the settings of a configurable formatter. Literal strings should not be touched in any case, though.

Cheers,
Bernhard
bpieber
 
Posts: 27
Joined: Sat Nov 04, 2006 4:00 am

Postby daswartz » Tue Dec 18, 2007 7:34 pm

bpieber wrote:Literal strings should not be touched in any case, though.

Yes!

I consider this "feature" changing tabs within literals to be a defect. We once ran into a case where the compiler recompiled a method in a unit test due to a class shape change. The recompiled method had tabs in a literal which got changed to spaces. This caused the unit test to fail. It was somewhat nasty to figure out, since we hadn't even browsed the method which was changed. Eventually we noticed that the method in our image had spaces, but the same edition of the method in Envy had tabs.

In our shop, we now always turn off the "convert tabs to spaces" setting, because it can't be trusted.
daswartz
 
Posts: 48
Joined: Sat Oct 21, 2006 8:12 am
Location: Omaha, USA


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest