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

 All Forums
 Visual Assist
 Technical Support
 BUG: Methods colored incorrectly as enum members
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - Jul 19 2020 :  12:49:53 PM  Show Profile  Reply with Quote
When an enum and class are declared in the same file if the class has method names that are the same as the Enum's members those class members are incorrectly colored with the "Enum Member" syntax color.

In the example code below the class methods Log.Error, Log.Warn and Log.Info are incorrectly colored with the "Enum Member" syntax color since they match the members of the enum LogLevel in the same file.

In the example image I've set the Enum Member syntax color to "Lime" to highlight the problem.

Example image:

Example code:

#pragma once

enum class LogLevel { Error = 0, Warn, Info };

class Log
	LogLevel m_LogLevel = LogLevel::Error;

	void Write(const char* text);
	void WriteLine(const char* text);

	void SetLevel(LogLevel LogLevel);
	void Error(const char* message);
	void Warn(const char* message);
	void Info(const char* message);

Edited by - tmek on Jul 19 2020 12:52:42 PM

Whole Tomato Software

United Kingdom
17110 Posts

Posted - Jul 20 2020 :  07:56:07 AM  Show Profile  Reply with Quote
Thank you for the clear example. Since you are using an enum class in this example, in theory, this might be slightly easier to handle. I have added this example to our case for this:


In general though, due to the way VA works, behind the back of the IDE, and that we are often colouring code as you are working on it, so we cannot assume that it is 100% valid, this is a very hard problem to completely fix.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000