Bug 2841 - Code completion for Generic class with construtor who has parameters not working
Summary: Code completion for Generic class with construtor who has parameters not working
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 2.8.5
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-01-11 07:37 UTC by jodur
Modified: 2015-08-20 03:24 UTC (History)
3 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 jodur 2012-01-11 07:37:01 UTC
Following example:

	public class myTestClass<T>
	{
		private int _val1;
		private string _val2;
		private T _data;
		
		public myTestClass (int val1,string val2)
		{
			_val1=val;
			_val2=Val2;
		}
		
		public T data
		{ get; set;}
	}

The code completion for this class doesn't work correctly.
Also methods,events and properties are not show up for code completion.
Comment 1 Mikayla Hutchinson [MSFT] 2012-01-12 13:42:12 UTC
Confirmed that for the following test case, the member "data" does not appear in code completion:

var f = new myTestClass<int> (1, 2);
f.
Comment 2 Mike Krüger 2012-01-17 02:32:02 UTC
Can someone provide a more complex test ?

This file works for me

--------------------------------------------------
 public class myTestClass<T>
    {
        private int _val1;
        private string _val2;
        private T _data;

        public myTestClass (int val1,string val2)
        {
            _val1=val;
            _val2=Val2;
        }

        public T data
        { get; set;}
    }

public class MyTest
{
	public static void Main (string[] args)
	{
		var f = new myTestClass<int> (1, 2);
		f.data // <-- completed here 

	}
}
----------

Tested with 2.8.5 and newresolver.

Regards
Mike
Comment 3 jodur 2012-01-17 07:34:23 UTC
Hereby the class expanded with a method and a event.

public class myTestClass<T>
	{
		
		public delegate void DataChanged();
		public event DataChanged DataChangeEvent;
		
		private int _val1;
		private string _val2;
		private T _data;
		
		public myTestClass (int val1,string val2)
		{
			_val1=val;
			_val2=Val2;
			if (DataChangeEvent != null)
			{		
			DataChangeEvent();
			}	
		}	
					
		public T data
		{ get; set;}
		
		public void Method()
		{
		Console.WriteLine( _val2); 	
		}
		
		
		
	}

public class MyTest
{
    public static void Main (string[] args)
    {
        var f = new myTestClass<int> (1, 2);
        f. <=Property, method or event doesn't show up!!

    }
}
How to install/use the new resolver so i can test it??
Comment 4 Mike Krüger 2012-01-19 09:25:38 UTC
Still works for me in 2.8.5. 

Ensure that the file is parseable at one point 
take away the "f." and type - and then do it again. It should work. However the newresolver branch should work in any case. 

You need to go to github

https://github.com/mono/monodevelop

Clone it, check out newresolver & build. But I don't know if I would recommend doing that.
Comment 5 Mike Krüger 2012-02-17 07:26:44 UTC
Works in new resolver branch.