Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Escape sequence hightlightning
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 15 2004 :  5:37:35 PM  Show Profile
For complex string sequences with lots of escape sequences it would be really nice to have the sequence under the cursor highlighted. Like in:
pszText = _T("\\nuhm, some \\\\\\"text\\"\\\\\\n");
where the caret is between the slash and the second quote. Same for highlighting octal and hex sequences like in:
\\01010101lI??!\\\\x80\\x80
with the cursor in the first octal sequence.
This really would help in almost any C/C++ string which contains any type of sequence.

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 16 2004 :  06:27:53 AM  Show Profile
who do i have to bribe to get this???

zen is the art of being at one with the two'ness
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 16 2004 :  06:55:33 AM  Show Profile
I'd like to get one step forward:
Color EVERY Escape Sequence, not only those with the caret between...


Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 16 2004 :  06:58:14 AM  Show Profile
that would of course be even better, especially since it would help to highlight incorrect escape sequences in strings

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 16 2004 :  09:20:30 AM  Show Profile
That would look like a rainbow, or if everything is the same color, render it useless.
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 16 2004 :  09:25:13 AM  Show Profile
So make it cycling in brightness (of course the User should be able to select the color).
Let's say the User chose RED as color.

First Escape-Sequence: RED
Second: Darker RED
Third: even darker RED
Fourth: RED again...

...and so on.

In your example:
pszText = _T("\\r\\nuhm, some \\\\\\"text\\"\\\\\\r\\n");



Edited by - WannabeeDeveloper on Mar 16 2004 09:27:55 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 16 2004 :  09:27:57 AM  Show Profile
ah, i think i see your concern. what about something like this:

pszText = _T("\\r\\nuhm, some \\\\\\"text\\"\\\\\\r\\n");

which is what i had imagined. i would end up with three colours, since i have my strings coloured that pink colour. the shade took a bit of getting used to, but i like to be able to easily spot strings

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 16 2004 :  09:32:24 AM  Show Profile
quote:
Originally posted by WannabeeDeveloper

So make it cycling in brightness (of course the User should be able to select the color).


personally i would be happy with one colour for the escape codes, and a second colour for the "current" escape code. i find this (yet again in vim) useful for things like:

debug("checking the values\\na = {%d}\\nb = {%d}\\nc = {%d}", a, b, c);

zen is the art of being at one with the two'ness
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 16 2004 :  09:36:46 AM  Show Profile
Agreed...
Maybe another Idea:
Since VA_X already hijacks the Code-Window, it could also (easily?) replace "known" Escape-Sequences with symbols from a Symbol-Font... but maybe this would be too confusing... maybe coloring them is enough...

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 16 2004 :  09:48:14 AM  Show Profile
*um* what sort of symbols were you thinking of? what about things like:

debug("value a: %06.2d", a);

my gut reaction is that symbols would be very confusing. however, if you have an example of how it might make sense...

also, wouldn't mixing fonts in the editor window be asking for trouble?

zen is the art of being at one with the two'ness

Edited by - feline on Mar 16 2004 09:49:05 AM
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 16 2004 :  09:52:20 AM  Show Profile
Yup, it probably would...

I thought of the "simple" Escape-Sequences (like \\t, \\n etc). Maybe a "TAB" in a single character (I think there is a ANSI-Code for that, not sure, though), or an arrow like on the enter-key for \\n or something like that.

Might be too confusing, though...

Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 16 2004 :  10:33:22 AM  Show Profile
Naaah, that would really be too much and go too far from the C/C++ Language definition. Just simply highlightning of sequences would be very helpful.
(But for the %06.2d sample another idea is coming up. You know the "Format Cell" command in Excel? I'd like to see a "printf expression builder" in the context menu. )
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Mar 16 2004 :  10:34:15 AM  Show Profile
Mixing fonts in the source window is not really an option. We do not have enough control over the IDE to make that happen.

The IDE updates the source window in some ugly ways. It is one reason why coloring doesn't always work -- the IDE paints text in ways we do not expect. There must be 50 ways... Localized IDEs, language packs and IDEs with non-US English languages settings give us the most trouble. We could devote all of our resources to coloring and make a product that did only that. We sometimes wonder if that would be better than offering so many features -- each of which does not work for someone. But, every developer deals with the same issue.

We still have a problem with tri-colored text. Top, middle and bottom are different colors. Go figure.

As for coloring of escape sequences, we like the notion of distinguishing them. Keep discussing the topic. If we do anything, we will consider ease of implementation and level of quality when selecting an approach.

Whole Tomato Software, Inc.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 16 2004 :  10:39:07 AM  Show Profile
That sounds like "come up with a reasonable implementation and we do it"
I imagine that this rather simple sounding feature requires lots of changes to the parser (it does not yet parse the contents of strings) and also the internal data structure which represents the code (it has no representation for string contents, only for the string as one entity) and of course the coloring engine.
Its probably at least a week of work and lots of testing. Right?

... but it would be so nice...
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 16 2004 :  12:13:45 PM  Show Profile
Hmm... does anyone know a huge company that would buy 50.000 Licenses only if this feature would be implemented?

Unfortunately, I don't... but, if I hadn't already bought VA .NET, I certainly would (after you implemented this feature, of course)!

Is that convincing enough?

Leon, could you explain your idea of the "printf expression builder" a bit more?
I am not sure what you mean with that... but it sounds great...

Or, wait a moment....

As soon, as you press "%", an autotext Popup could appear suggesting %d, %i etc., but only if it's within quotation marks ("). Is that what you meant?

Now if I only knew a huge company...


Edited by - WannabeeDeveloper on Mar 16 2004 12:23:09 PM
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 16 2004 :  12:40:07 PM  Show Profile
Well, kind of. Yes. A nice small dialog where you can choose formatting options, choose the format type, precision, etc. Just like in Excel.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 17 2004 :  09:01:26 AM  Show Profile
i suspect such a dialogue is asking to much for the first version of this.

locating the standard escape sequences inside of strings shouldn't be to hard. i believe that VAX already knows which things are strings, since i recall a comment about a special case strings being processed by _T()

all of the examples so far look like C and C++ code. do these sort of escape sequences turn up in other languages VAX handles? something to at least consider.

the easiest initial solution would be to have a single colour and to highlight all escape sequences in this colour, ignoring the cursor position. this saves on having to update the screen as you move the cursor around. i am guessing that the wizard bar is easier to update constantly, since this is independent of the source code window.

this shouldn't add much overhead to the syntax highlighting in most cases, since most of my code doesn't have strings with escape sequences in it.

Uniwares how useful would seeing all of the escape codes highlighted be? i am hoping this will be a start point, so that VAX can slowly expand its features here over time

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 17 2004 :  09:32:11 AM  Show Profile
I'm not sure that it really would be helpful to see ALL sequences shining brightly in various colors. I fear that its too "colorful" even with different shades (Uhm, could we also have nicer tomato icons in various shades of red?).

Of course, the "printf format builder" is asking very much indeed. It was just a side-suggestion
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 17 2004 :  09:43:55 AM  Show Profile
i meant all of the escape sequences in the same colour, and the same shade.

a second colour for the escape sequence you are currently editing would be very nice, if we can get it

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 17 2004 :  10:39:04 AM  Show Profile
Well, the point is that when you have consecutive sequences, the hightlightning looses its value because you have just a sequence of colored characters and again you dont see the escape sequences. e.g. (sequences in blue):
... = "\\r\\n\\t\\t%16I64x\\t%2.2d%%\\"%-10s\\"";
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 17 2004 :  11:13:13 AM  Show Profile
this is true. most of my strings aren't quite so full of escape sequences.

i am trying to workout the minimum amount of work for VAX that will give us most of what we want. do you tend to have solid sets of escape sequences like this? or are you more prone to escape sequences scattered through a string.

i still love the idea of highlighting the current escape sequence, but i suspect this may be a fair amount of work / overhead.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 17 2004 :  2:59:07 PM  Show Profile
I'd say that most sequences are either simple "\\r\\n" where it makes not much of a difference if you highlight them or not, or the total opposite - complex formatting strings - like the prevous example. I'd say that's a fifty-fifty.

I guess the work to highlight the current sequence is about as complicated as the matching brackets highlightning is already.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 17 2004 :  6:05:06 PM  Show Profile
my strings tend to be slightly less heavy on the escape sequences, but not all of them.

i agree that parsing the strings should be a doddle given what VAX already does

the obvious issue is going to be performance. if this is a concern with highlighting the current escape sequence as you move the keyboard cursor through the string, what about the mouse cursor?

personally i am keyboard centric, so i am not that keen on this, but it is a halfway house. mouse hover events already trigger tool tips, and if you are hovering the mouse you aren't typing at full speed, so using up a load of CPU cycles arguing with the IDE isn't an issue.

as you hover the mouse pointer over a part of the string, highlight the entire escape sequence that you are over in the chosen colour.

further, if you are hovering over a string with escape sequences, but not actually over an escape sequence then highlight the closest escape sequence in the chosen colour.

zen is the art of being at one with the two'ness
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 18 2004 :  04:16:53 AM  Show Profile
We seem to be talking both about escape sequences (e.g., \\r) and printf conversion specifications (e.g., %d).

It seems to me that colouring conversion specifications is more useful, but probably much harder because you have to know that a printf format string is expected. You don't really want to go around colouring a %d that happens to occur in any old string. But how do you know whether a string is going to be used as a printf format in the future? (Of course, if you're prepared to put up with false positives, this problem goes away.)

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 18 2004 :  07:22:23 AM  Show Profile
off the top of my head, i don't think i ever use printf conversion specifications outside of strings destined for printf, etc.

zen is the art of being at one with the two'ness
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 18 2004 :  07:38:45 AM  Show Profile
I suppose in normal text one would normally have a space after a percent sign, so maybe the false positives are rare enough to be acceptable.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Mar 18 2004 :  1:44:47 PM  Show Profile
Think so too. Besides, strings which are not being used as formatting string are always in a resource file, right? Or? Dont tell me you are STILL hardcoding strings into your source code.
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 18 2004 :  2:01:00 PM  Show Profile
You're right, we're not!

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000