Home

Bug - Intellisense does not work within a nested object initiailizer

edited October 2018
When using and object initializer on a property within a parent object initializer, the intellisense show the global intellisense list.
This code shows the issue:
void Main()
{
	new Foo
	{   // Placing cursor after this brace and pressing space gives a drop-down list with "Qux", as expected
		Bar1 = 
		{	// Placing cursor after this brace and pressing space give th same list as Ctrl+Space in an empty query.  Expected a list with "Baz".
		},
		Bar2 = new Bar
		{   // Placing cursor after this brace and pressing space gives a drop-down list with "Baz", as expected
		}
	}.Dump();
}

// Define other methods and classes here
class Foo 
{
	public Foo()
	{
		Bar1 = new Bar();
	}

	public Bar Bar1 { get; set; }
	public Bar Bar2 { get; set; }
	public string Qux { get; set; }
}

class Bar
{
	public string Baz { get; set; }
}

I'm running this in a licensed copy of LINQPad v5.31.0
Sign In or Register to comment.