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

 All Forums
 Visual Assist
 Technical Support
 Refactor: Renaming enumeration values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mspa
Senior Member

Netherlands
44 Posts

Posted - Aug 21 2006 :  07:41:39 AM  Show Profile  Reply with Quote
MSVC 2003, C#, VAX 1532.

When I want to rename an enumeration value using refactoring, I expect that also each reference I use of this value is renamed. However those are not found and not renamed.

However a lot of other incorrect references are found. When I have an enumeration value 'Console' and want to rename it, each call to Console.WriteLine() is also found.

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 21 2006 :  7:19:11 PM  Show Profile  Reply with Quote
i am seeing the same thing here

case=2188

i can understand why the parser is getting confused with this. did you inherit this code from someone else? it seems like a rather confusing name to have selected, even allowing for how you reference enum's in C#

zen is the art of being at one with the two'ness
Go to Top of Page

mspa
Senior Member

Netherlands
44 Posts

Posted - Aug 22 2006 :  03:17:32 AM  Show Profile  Reply with Quote
That's the reason I wanted to rename the enumeration value using refactoring

Actually I agree that the name of the enumeration value is not the best but on the other hand what is so against naming enumeration values the same as existing classes that have nothing to do with it.

To clearify, the enumeration is used to specify how output is shown to the user:

enum DisplayOption
{
   Console,
   Dialog,
   Both
}
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 26 2006 :  1:35:58 PM  Show Profile  Reply with Quote
speaking as a full time C++ programmer, "how can i tell what i am doing"?

over time the way C# handles its enum's is definitely growing on me, especially since i keep on getting name conflicts with my enum values. *considers* actually inspired by this i probably need to wrap each of my problem enum's in their own individual namespaces.

from a purely practical, helping VA to work point of view the problem is that the code that does the enhanced syntax colouring is quite limited, it has to be in order to run fast enough to do real time colouring. as a result duplicate names tend to confuse it, leading to strange and confusing colouring.

which is at odds with your very sensible enum names. sometimes the best answer is not all that obvious

zen is the art of being at one with the two'ness
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Aug 29 2006 :  01:20:12 AM  Show Profile  Reply with Quote
An alternative to "individual namespaces" is a class/struct (yea, it is essentially the same).

Joe Pizzi
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Sep 02 2006 :  12:25:24 PM  Show Profile  Reply with Quote
i tried the namespace, but it seems you cannot create a new namespace inside a class. it makes sense, but was not helpful.

the class in question has 9 enum's in it already, some of which want to have overlapping names. i may try wrapping them in stuctures / classes next time i have to edit them, at least i know that will compile

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jul 07 2007 :  12:38:30 AM  Show Profile  Reply with Quote
case=2188 is fixed in Build 1559
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000