PDA

Click to See Complete Forum and Search --> : Visual Studio 2010 and Enums...


chris128
May 31st, 2010, 06:58 AM
Has anyone else noticed in VS2010 that when you need to enter an Enum value for a parameter to a method, the intellisense list that pops up doesnt always just show you the relevant enum values, it sometimes shows you absolutely everything?
This does not happen all the time and it does not happen consistently with the same methods... but it happens often enough to be annoying. For example even on the humble MessageBox.Show method I often find that for the parameter where you specify the icon, I press E thinking that it will highlight the Error icon only to find that it has actually broughy up every type beginning with E...

Anyone else seen this?

NickThissen
May 31st, 2010, 07:24 AM
If you click the Common tab then it will only list the enum values, and possibly variables of the correct type. However, it does seem a little arbitrary whether it selects the Common or All tab by default, and having to grab your mouse to click the Common tab is a little annoying, so I'd like to hear if there's some setting for this, or something..?

On a slightly related note, VS2010 (in VB at least, don't think it happens in C#) still has the same "bug" as in VS2008: if you need to enter, for example, a Color into some method / constructor, then it only lists the shared Color properties, and not any local or global variables of type Color:
http://i48.tinypic.com/riagih.jpg
(Pic is in VB2008 because I don't have access to VS2010 right now, but I'm pretty sure the same thing happens there).

The same thing happens when you then try to use the brush 'b' in some drawing method (FillRectangle for example). It's really annoying because if you do just type 'b' and then type a comma for the next parameter, it will autocomplete it to Brushes.Beige, which is obviously not what I wanted. So I have to type 'b', hit escape to close Intellisense, and then type the comma. Not much more work, ok, but the escape key is quite far up and not easy to reach and it breaks my flow :p Just annoying.

Pradeep1210
May 31st, 2010, 07:57 AM
Has anyone else noticed in VS2010 that when you need to enter an Enum value for a parameter to a method, the intellisense list that pops up doesnt always just show you the relevant enum values, it sometimes shows you absolutely everything?
This does not happen all the time and it does not happen consistently with the same methods... but it happens often enough to be annoying. For example even on the humble MessageBox.Show method I often find that for the parameter where you specify the icon, I press E thinking that it will highlight the Error icon only to find that it has actually broughy up every type beginning with E...

Anyone else seen this?

I'm using VB2008 and I haven't seen this behavior yet in VB2008. It could be possible that it is some bug in VB2010, or I'm missing the point completely.
Would it be possible to show us a screenshot of how it looks like when this problem occurs?

Pradeep1210
May 31st, 2010, 08:12 AM
If you click the Common tab then it will only list the enum values, and possibly variables of the correct type. However, it does seem a little arbitrary whether it selects the Common or All tab by default, and having to grab your mouse to click the Common tab is a little annoying, so I'd like to hear if there's some setting for this, or something..?


This is what I have observed:
Until neither Common nor All tab has been selected explicitly, it defaults to Common tab. Once you click either of the tabs, then it remains on that tab.


On a slightly related note, VS2010 (in VB at least, don't think it happens in C#) still has the same "bug" as in VS2008: if you need to enter, for example, a Color into some method / constructor, then it only lists the shared Color properties, and not any local or global variables of type Color:

(Pic is in VB2008 because I don't have access to VS2010 right now, but I'm pretty sure the same thing happens there).

The same thing happens when you then try to use the brush 'b' in some drawing method (FillRectangle for example). It's really annoying because if you do just type 'b' and then type a comma for the next parameter, it will autocomplete it to Brushes.Beige, which is obviously not what I wanted. So I have to type 'b', hit escape to close Intellisense, and then type the comma. Not much more work, ok, but the escape key is quite far up and not easy to reach and it breaks my flow :p Just annoying.
This doesn't seen to be related to the Common/All tabs at all, since there are no tabs in the intellisense for Enums. The behavior is bad, but predictable atleast. It doesn't behave differently in different situations, or in unpredictable way. So doesn't look like a bug, but missing feature that may be added in future versions.

But I agree that the behavior is annoying. I'm not happy with how the intellisense for Enums work either. It would have been good to see two tabs - Common and All, just like other variables. On the Common tab it could list what it currently does (enum members), while on the All tab it could show enum members and our local variables of relevent type.

NickThissen
May 31st, 2010, 08:29 AM
In VS2010, the enum intellisense will show the Common and All tabs. Common will only show the enum members plus any variables of the correct type, while All will literally show everything (as far as I can see), even completely unrelated members / types. In VS2008, the enums didn't show these tabs and always seemed to behave as if the common tab was selected.

chris128
Jun 1st, 2010, 03:08 AM
Exactly, its definitely only an issue in VS2010 and not VS2008. It doesnt seem to follow any pattern though, I mean I always have the ALL tab selected in intellisense but sometimes when I am entering an enum parameter it lists just the enum values as it should, but other times it shows me everything..