Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 BUG: Methods colored incorrectly as enum members

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
tmek Posted - Jul 19 2020 : 12:49:53 PM
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:
https://i.imgur.com/x7vc7d8.png

Example code:

#pragma once

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

class Log
{
private:
	LogLevel m_LogLevel = LogLevel::Error;

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

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

1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 20 2020 : 07:56:07 AM
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:

case=660

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.

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