Author Topic: B5: C++ Syntax coloring enums (quirk - probably exists in v18 too)  (Read 2629 times)

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
B5: C++ Syntax coloring enums (quirk - probably exists in v18 too)
« on: September 17, 2014, 07:14:38 PM »
Typical syntax coloring quirk I always throw out during betas :)

I've got an enum declared in a header/.h file within a namespace:

Code: [Select]
namespace fred
{
enum myEnum
{
     myenum_good = 0,
     myenum_bad,
     myenum_indifferent
};
}

And implementation code in a separate .cpp file that looks something like this:
Code: [Select]
namespace fred
{
myEnum someClass::DoStuff()
{
// blah
  return myenum_bad;
}
}

The syntax coloring for the enum declaration is correct (and in the project file for tagging, along with the cpp file) but the enum usage in the implementation is marked as symbol not found (but you can right click on it and jump to the definition so the tagging database does have it correctly)

Offhand I'm guessing it has something to do with the namespace and/or class context that's confusing the colorer...

Addenum - Found the syntax coloring option I was looking for:  I've got symbol coloring/symbol lookup set for "Use relaxed symbol lookups"
« Last Edit: September 17, 2014, 07:28:02 PM by skywise »

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
Re: B5: C++ Syntax coloring enums (quirk - probably exists in v18 too)
« Reply #1 on: September 17, 2014, 08:16:08 PM »
That's a confirm - If I move the enum declaration out of the namespace the coloring is fine for both global functions and class members that use the enum - Back in the namespace they're both declared as "not found"

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: B5: C++ Syntax coloring enums (quirk - probably exists in v18 too)
« Reply #2 on: September 18, 2014, 11:47:18 PM »
I can't reproduce this problem.  In both v18 and v19 b5, the symbol coloring gets the enumerated types correct.  Maybe the actual use case is a bit more complex than this example?

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
Re: B5: C++ Syntax coloring enums (quirk - probably exists in v18 too)
« Reply #3 on: September 18, 2014, 11:59:32 PM »
It's a large (~10,000 files) workspace and it's likely there are some side conflicts (EG the filename may be the same as another but in a different path.) I'm pretty sure the enum in question is unique workspace wide BUT our development system is setup that we have project branches of existing code that build in tandem with the main trunk.  We then make modifications/feature enhancement to specific files in the branch and the build system automatically builds from the trunk or branch depending on the existence of the files (it's a bit more explicit then that but I don't want to go into details)  I know that the enum header file was declared twice in the workspace tagging file (once in the existence of the main branch and once in the existence of our development branch as we added values to the enum) and I did try removing it while testing this but it didn't seem to have any affect on the coloring.

Would sending you the tagging database help?