|
|
|
@ -264,6 +264,73 @@ class MyTest
@@ -264,6 +264,73 @@ class MyTest
|
|
|
|
|
Assert.IsNotNull (provider.Find ("Str"), "field 'Str' not found."); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Bug 2434 - Object-Initializer Intellisense broken when using constructor arguments
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Test()] |
|
|
|
|
public void TestBug2434 () |
|
|
|
|
{ |
|
|
|
|
CodeCompletionBugTests.CombinedProviderTest ( |
|
|
|
|
@"
|
|
|
|
|
class User |
|
|
|
|
{ |
|
|
|
|
public User() {} |
|
|
|
|
public User(int id) { } |
|
|
|
|
|
|
|
|
|
public string Id { get; set; } |
|
|
|
|
public string Name { get; set; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class MyTest |
|
|
|
|
{ |
|
|
|
|
static string Str = ""hello""; |
|
|
|
|
|
|
|
|
|
public void Test () |
|
|
|
|
{ |
|
|
|
|
$new User(12) { |
|
|
|
|
N$ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
", provider => {
|
|
|
|
|
Assert.IsNotNull (provider.Find ("Id"), "Property 'Id' not found."); |
|
|
|
|
Assert.IsNotNull (provider.Find ("Name"), "Property 'Name' not found."); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test()] |
|
|
|
|
public void TestBug2434Case2 () |
|
|
|
|
{ |
|
|
|
|
CodeCompletionBugTests.CombinedProviderTest ( |
|
|
|
|
@"
|
|
|
|
|
class User |
|
|
|
|
{ |
|
|
|
|
public User() {} |
|
|
|
|
public User(int id) { } |
|
|
|
|
|
|
|
|
|
public string Id { get; set; } |
|
|
|
|
public string Name { get; set; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class MyTest |
|
|
|
|
{ |
|
|
|
|
static string Str = ""hello""; |
|
|
|
|
|
|
|
|
|
public void Test () |
|
|
|
|
{ |
|
|
|
|
string myString; |
|
|
|
|
|
|
|
|
|
$new User(12) { |
|
|
|
|
Name = S$ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
", provider => {
|
|
|
|
|
Assert.IsNull (provider.Find ("Id"), "Property 'Id' found."); |
|
|
|
|
Assert.IsNull (provider.Find ("Name"), "Property 'Name' found."); |
|
|
|
|
Assert.IsNotNull (provider.Find ("Str"), "Field 'Str' not found."); |
|
|
|
|
Assert.IsNotNull (provider.Find ("myString"), "Local 'myString' not found."); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|