Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1555, 1557 Syntax Highlighting, trailing spaces

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
garth Posted - Jun 05 2007 : 9:20:14 PM
With something as simple as:

int main(void)
{
	int tmp;
	return 0;
}

main is properly colored as a function, but tmp will be colored as 'Classes, structures and typedefs' instead of 'Variables'. However, if I put a space after the semicolon, the coloring switches to variable. If I remove the space, it reverts back to typedef. Playing around, it seems like tmp is colored like a typedef until it is followed by at least one puncuation character and then at least one non-punctuation character (there can be whitespace between tmp and the punctuation). Is this behavior expected?
13   L A T E S T    R E P L I E S    (Newest First)
garth Posted - Jun 10 2007 : 11:36:01 PM
Thanks for the help. I'll just turn off bold in the meantime.
feline Posted - Jun 08 2007 : 3:41:03 PM
That is a lot of colours to work through. I am not sure of the exact trigger, but I can reproduce the problem on a second machine by exporting the VS2005 settings from the problem machine and importing them. So I can reproduce this on demand, which is good enough for now:

case=6996
garth Posted - Jun 08 2007 : 3:19:45 PM
I'm not sure which background you're talking about. My desktop color is a dark red. The background to explorer windows is light grey (238,238,238). The background to Visual Studio's text editor is black. I use classic window decorations. I'm not using Window Blinds or any other third-party customization (as far as I can tell), but I've pretty much altered every color I can touch.

Also, it's whitespace after the semicolon that fixes the color. If you initialize the variable, the color should be correct as well (as soon as you add a non-operator after the '=').
feline Posted - Jun 08 2007 : 09:28:53 AM
Have you changed your global windows background colour? Are you using a custom theme, or Window Blinds?

I can re-produce virtually the same problem, but only on one machine. On other test machine's the problem does not happen, and so far I have not been able to pin down why. There seems to be some additional trigger for this bug.

The only obvious difference in the machine where I can reproduce this is that the global windows background colour has been changed. On this machine white space makes no difference. This is what I am seeing:

garth Posted - Jun 07 2007 : 5:08:01 PM
The context and definition remain the same with and without the space.

However, I have much better repro steps.
It only happens when I have both Keywords and Operators formatted bold in Visual Studio's settings. I'm using the Lucida Console font.
feline Posted - Jun 07 2007 : 4:07:26 PM
Apologies, I was not very clear. I see what you are doing now. Personally I am used to seeing this done this way instead:

#include <crtdbg.h>

struct MyStackChecker {};
#define PREAMBLE MyStackChecker hiddenStackChecker;

void f1() {
#ifdef _DEBUG
    MyStackChecker hiddenStackChecker;
#endif
    
    _ASSERT(1 == 1);
}


which avoids the problem with the missing semi-colon.

From the original post I thought you were actually doing something like this:

#define MACRO1 namespace {
#define MACRO2 };

these sort of macro's are normally the things people do that confuse VA, since they contain unbalanced brackets, and are then used in code that also has unbalanced brackets, but everything eventually balances when you compile the code. So I was thinking about something totally different
steinsomers Posted - Jun 07 2007 : 2:00:11 PM
I had a hard time understanding that what you meant with why this was happening. It's happening because VA doesn't have the time to parse everything meticulously, I guess, but you can't be asking me that.

Now I think I'm tuned to the same frequency. The real code is pretty much like this:
#include <crtdbg.h>

struct MyStackChecker {};
#define PREAMBLE MyStackChecker hiddenStackChecker;

void f1() {
    PREAMBLE
    
    _ASSERT(1 == 1);
}

PREAMBLE would be defined to nothing in an optimized build, and MyStackChecker needs some sort of implementation, but I think you get the point. I realize it's a lot more parser-friendly to type the semicolon after PREAMBLE, but I hadn't experienced any problem with it. And I don't anymore now that I've put the define in VA's StdAfx.h
feline Posted - Jun 07 2007 : 11:24:17 AM
steinsomers if you are happy to simply ignore this problem, or edit VA's stdafx.h file then this would help. The main reason for asking about the macro's was to understand why this was happening, in case it is something a lot of people will want to do with macro's. The more common a problem is, the more important it is.


garth any add-in's should be listed in the Add-in manager, so it sounds like there are not any more.

Can you try placing the caret into the problem symbol and looking at VA's context and definition fields. Does the information shown here change as you add and remove the space, changing the colour of the symbol?

I am wondering if there is a macro somewhere that is confusing VA parser. I am not sure what else might be causing this.
steinsomers Posted - Jun 07 2007 : 08:15:08 AM
quote:
Originally posted by feline

I assume the real macro's are a bit more complex. Are you able to post them, for reference?


Able to some degree, but I don't see the point of posting tons of (fragments of?) files if it doesn't work for the simplest example to begin with. It doesn't bother me much anyway. As long as I get a lively colorful screen, I know VA is ready to offer me the suggestions and refactoring I really dig.

quote:
Originally posted by garth

the change in that case isn't immediate, you have to pause a moment

Indeed that's what I see. But my report seems unrelated to your issue so let's forget it.

I don't see garth's issue in VC++ 2005 Professional SP1. I do see a the class color initially if you pinch the 'p' off the variable. The variable pretends to be the standard C tm struct, even if you wait and move around. It only dresses up as a variable if you type a space after the semicolon... but also if you type anything else any other place. Although it takes a little while if you type on a different line. And once VA thinks it's a variable, it stays that way until you actually rename it.
garth Posted - Jun 06 2007 : 2:34:11 PM
I'm using VS2005 team suite with C/C++.
I also use IncrediBuild (http://www.xoreax.com/main.htm), though I don't think that does anything with formatting.
I may have settings or add-ins I don't actively know about, since we use some shared settings here and I'm not sure what's in IT's default install. WorkspaceWhiz was initially installed, but I have removed it. The only thing listed in Tools|Add-in Manager is Visual Assist X. Anything else I should be checking?

I tried out what steinsomers mentioned, and I do see that behavior as well. However, the change in that case isn't immediate, you have to pause a moment (presumably to let VA to do some parsing). In the case I have mentioned, the coloring changes immediately as I add or delete a space. I use those two colors in Visual Assist and nowhere else.
feline Posted - Jun 06 2007 : 12:00:08 PM
I am seeing the same thing here. I assume the real macro's are a bit more complex. Are you able to post them, for reference?

If this problem is specific to macro's then the easiest solution may be to just edit VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add the entry:

#define MACRO1
#define MACRO2

at the bottom. This file is used to help VA's parser with difficult code, and can be used to work around odd effects. After modifying this file you need to rebuild the VA symbol database for the changes to take effect:

VA Options -> Performance -> General -> Rebuild symbol databases
steinsomers Posted - Jun 06 2007 : 11:52:07 AM
I didn't really look at it over time, but I happened to notice some improper coloring when I installed 1557.
A macro is shown as a variable.
And indeed it is reproducable and may be related.

#define MACRO1 ;
#define MACRO2

void f() {
    MACRO1
    MACRO2
}

Append a semicolon to the "statement" and MACRO2 is recognized:

#define MACRO1 ;
#define MACRO2

void f() {
    MACRO1;
    MACRO2
}

If you put both in the same file, neither MACRO2 is colored, whether the "missing" semicolon is first or last.
This is a .cpp file in VC++2005 SP1.
feline Posted - Jun 06 2007 : 09:00:44 AM
This is not what I would expect, and simply copy / pasting this code into VS2005 with VA 1557 is not showing any problem.

Which IDE are you using?
Which language are you programming in?
Do you have any other plugin's installed?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000