Bug 2109 - [Regression] Incorrect autocompletion when declaring an enum
Summary: [Regression] Incorrect autocompletion when declaring an enum
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
: 2142 ()
Depends on:
Blocks:
 
Reported: 2011-11-21 05:39 UTC by Alan McGovern
Modified: 2015-08-20 03:24 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alan McGovern 2011-11-21 05:39:17 UTC
1) Declare a new enum

public enum Foo
{
      
}

2) Try to add members to the enum, you are incorrectly given autocomplete options for all the types in the DOM

public enum Foo
{
    Arr$  
}


Solution: You should not be offered any options like this when adding members to an enum
Comment 1 Mike Krüger 2011-11-25 07:37:19 UTC
*** Bug 2142 has been marked as a duplicate of this bug. ***
Comment 2 Mike Krüger 2011-11-25 08:12:10 UTC
fixed.
Comment 3 Alan McGovern 2011-11-28 05:57:10 UTC
It's still not quite fixed, here's a screencast showing two issues which remain:

1) Code completion is incorrectly popping up after the ',' context when declaring the second and subsequent members of the enum

2) The static TryParse method is showing up when it shouldn't be. It should normally only be accessible from 'Enum.TryParse' not Foo.TryParse where 'Foo' is of type enum.

http://screencast.com/t/qhS3NP1fqrTp
Comment 4 Mike Krüger 2011-12-13 04:57:31 UTC
fixed.
Comment 5 Alan McGovern 2012-01-09 10:33:12 UTC
Both issues mentioned in comment 3 are still in the new resolver branch in commit b00a2d77b6.
Comment 6 Alan McGovern 2012-01-09 10:36:45 UTC
Additional issue:

If you begin declaring an enum inside a class, MonoDevelop tries to offer completion while writing the enum name which is incorrect. i.e. it offers completion at the dollar sign when it should not:

namespace Foobar
{
	class MainClass
	{
		public enum $
	}
}
Comment 7 Alan McGovern 2012-01-09 10:43:59 UTC
Another problem:

namespace Foobar
{
	class MainClass
	{
		public enum Foo
		{
			Value1,
			Value2
		}
		
		public class Test
		{
			Foo Foo {
				get; set;
			}
			
			public static void Method (Foo foo)
			{
				Foo.$
			}
		}
	}
}

In this scenario there are *lots* of extra entries in the enum
Comment 8 Alan McGovern 2012-01-09 10:46:37 UTC
The extra entries appearing in the sample in comment 7 appear to be caused by the property being named 'Foo'. If i change the property name to 'Foob' then a lot of them vanish.
Comment 9 Mike Krüger 2012-02-17 08:11:10 UTC
The last case is very complex ^^.

It was difficult to decide where to handle it ... but at least it works now and it's part of our growing unit test suite.

The completion engine is only as good as it's test suite ^^.