Skip to content

Commit

Permalink
Merge pull request #47685 from CyrusNajmabadi/newtest
Browse files Browse the repository at this point in the history
Add test to validate non-repro issue.
  • Loading branch information
msftbot[bot] authored Sep 15, 2020
2 parents 7cfccac + bd843fb commit eba6123
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,37 @@ record Base(int Alice, int Bob)
End Using
End Function

<WorkItem(47430, "https://github.com/dotnet/roslyn/issues/47430")>
<WpfTheory, CombinatorialData>
<Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function CompletionOnWithExpressionForTypeParameter(showCompletionInArgumentLists As Boolean) As Task
Using state = TestStateFactory.CreateCSharpTestState(
<Document>
public abstract record MyRecord
{
public string Name { get; init; }
}

public static class Test
{
public static TRecord WithNameSuffix&lt;TRecord&gt;(this TRecord record, string nameSuffix)
where TRecord : MyRecord
=> record with
{
$$
};
}
</Document>,
showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9)

state.SendTypeChars("N")
Await state.AssertSelectedCompletionItem(displayText:="Name", isHardSelected:=True)
state.SendTab()
Await state.AssertNoCompletionSession()
Assert.Contains("Name", state.GetLineTextFromCaretPosition(), StringComparison.Ordinal)
End Using
End Function

<WorkItem(44921, "https://github.com/dotnet/roslyn/issues/44921")>
<WpfTheory, CombinatorialData>
<Trait(Traits.Feature, Traits.Features.Completion)>
Expand Down

0 comments on commit eba6123

Please sign in to comment.