Author |
Topic |
|
eluka
New Member
4 Posts |
Posted - Mar 24 2004 : 8:25:47 PM
|
Hello! First of all thank you guys for this great tool :) Secondly I think that it would be great if there will be a way to highlight such construction:
#ifdef SOMESYMBOL
..code.. //if defined SOMESYMBOL - normal highlighting
#else
...some other code //if not defined SOMESYMBOL - some other highlighting (gray for example)
#endif or
#ifndef SOMESYMBOL
..code.. //if not defined SOMESYMBOL - normal highlighting
#else
...some other code //if defined SOMESYMBOL - some other highlighting (gray for example)
#endif
What I mean is that it would be great if VA could highlight code that I'm currently not using.
With the best wishes, Eugene |
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Mar 24 2004 : 9:05:45 PM
|
VA can't know which symbols are defined or not defined. Probably it's different for different builds, and you need to be able to edit both branches, so it's right to colour all the code for you. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
Old as dirt
Tomato Guru
USA
246 Posts |
Posted - Mar 25 2004 : 10:32:55 AM
|
For what will be built if you just press the build button, why can't VA know what symbols are defined? |
Ken |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Mar 25 2004 : 10:54:52 AM
|
Maybe I was wrong to say it "couldn't" know. I guess it might be able to, if it can look up all the compilation and header file settings — I don't know how hard that would be. But anyway, I'm not sure I'd want it depending on that. For example, if I have code like#ifdef _DEBUG
...some sanity checking...
...some debugging output...
#endif I wouldn't want that code being greyed out just because I happened to have selected Release build in the drop-down. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
cskilbeck
New Member
4 Posts |
Posted - Jun 25 2004 : 3:43:02 PM
|
I would like to add my voice to this request - I would be happy to manually migrate project defines for VA, or, preferably, have VA get them from the currently active target.
We have a large, foreign codebase where #ifdef has been abused, and refactoring/navigating the code is tricky. |
|
|
PatLuja
Tomato Guru
Belgium
416 Posts |
Posted - Jun 28 2004 : 02:59:43 AM
|
Hello all,
I think VA X can know the some defines defined in the code, but I don't think it knows the compilation defines.
Another point that might be a hassle is that VA X should interpret the condition (without "compiling" the code). If you have some code like: #ifdef SOMEDEFINE and somewhere else (in some other files in your project) you have: #define SOMEDEFINE 0 and somewhere else: #define SOMEDEFINE 1 and yet somewhere else: #undefine SOMEDEFINE and somewhere: #define SOMEDEFINE SOMEOTHERDEFINE where SOMEOTHERDEFINE is defined in yet another file. And after all of these four examples, the file with the #ifdef is included... How should VA X possibly know if the code must be grayed out or not? (Maybe a standard could be that this should be treated as not grayed out.)
I think this is getting complex easily. And I guess that implementing this complex feature would introduce a few bugs into VA X; saying this without blemishing the known ability of the WholeTomato programmers. (If it was implemented, on the other hand, it would also open opportunities for several other features.)
Maybe support can bring some light into this?
With kind regards, Patrick Luja |
|
|
Baga
Tomato Guru
122 Posts |
Posted - Jun 28 2004 : 1:52:29 PM
|
I think VA can only do that much without actually compiling the code, and conditional coloring based on defined symbols is clearly out of it's domain.
What i think IS possible - make some 'hints' for VA's parser in comments, but even that is probably too complicated... |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jun 28 2004 : 6:19:48 PM
|
depending on what you want / need, 2253 may be of some use. |
zen is the art of being at one with the two'ness |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jun 28 2004 : 9:07:46 PM
|
patluja is correct.
We have attempted to implement this feature several times. It gets ridiculously confusing quickly. |
Whole Tomato Software, Inc. |
|
|
stephenk
New Member
8 Posts |
Posted - Jul 01 2004 : 06:34:33 AM
|
I agree that trying to figure out definitions is practically impossible.
However, even handling just the special case of #if <constant integer> #elif <constant integer> #endif would be very useful. Its a pain to put c comments around large blocks of code.
btw has everybody seen the c comment trick? /* <- insert leading / to toggle between foo and bar. foo; /*/ bar; //*/
|
|
|
|
Topic |
|