@@ -16,46 +16,46 @@ type CompletionTests() =
1616 use script = new FSharpScript()
1717 let lines = [ " let x = 1"
1818 " x." ]
19- let! completions = script.GetCompletionSymbols ( String.Join( " \n " , lines), 2 , 2 )
20- let matchingCompletions = completions |> List .filter ( fun s -> s.DisplayName = " CompareTo" )
21- Assert.AreEqual( 1 , List.length matchingCompletions)
19+ let! completions = script.GetCompletionItems ( String.Join( " \n " , lines), 2 , 2 )
20+ let matchingCompletions = completions |> Array .filter ( fun d -> d.Name = " CompareTo" )
21+ Assert.AreEqual( 1 , matchingCompletions.Length )
2222 } |> Async.StartAsTask :> Task
2323
2424 [<Test>]
2525 member _. ``Instance completions from a previous submission`` () =
2626 async {
2727 use script = new FSharpScript()
2828 script.Eval( " let x = 1" ) |> ignoreValue
29- let! completions = script.GetCompletionSymbols ( " x." , 1 , 2 )
30- let matchingCompletions = completions |> List .filter ( fun s -> s.DisplayName = " CompareTo" )
31- Assert.AreEqual( 1 , List.length matchingCompletions)
29+ let! completions = script.GetCompletionItems ( " x." , 1 , 2 )
30+ let matchingCompletions = completions |> Array .filter ( fun d -> d.Name = " CompareTo" )
31+ Assert.AreEqual( 1 , matchingCompletions.Length )
3232 } |> Async.StartAsTask :> Task
3333
3434 [<Test>]
3535 member _. ``Static member completions`` () =
3636 async {
3737 use script = new FSharpScript()
38- let! completions = script.GetCompletionSymbols ( " System.String." , 1 , 14 )
39- let matchingCompletions = completions |> List .filter ( fun s -> s.DisplayName = " Join" )
40- Assert.GreaterOrEqual( List.length matchingCompletions, 1 )
38+ let! completions = script.GetCompletionItems ( " System.String." , 1 , 14 )
39+ let matchingCompletions = completions |> Array .filter ( fun d -> d.Name = " Join" )
40+ Assert.GreaterOrEqual( matchingCompletions.Length , 1 )
4141 } |> Async.StartAsTask :> Task
4242
4343 [<Test>]
4444 member _. ``Type completions from namespace`` () =
4545 async {
4646 use script = new FSharpScript()
47- let! completions = script.GetCompletionSymbols ( " System." , 1 , 7 )
48- let matchingCompletions = completions |> List .filter ( fun s -> s.DisplayName = " String" )
49- Assert.GreaterOrEqual( List.length matchingCompletions, 1 )
47+ let! completions = script.GetCompletionItems ( " System." , 1 , 7 )
48+ let matchingCompletions = completions |> Array .filter ( fun d -> d.Name = " String" )
49+ Assert.GreaterOrEqual( matchingCompletions.Length , 1 )
5050 } |> Async.StartAsTask :> Task
5151
5252 [<Test>]
5353 member _. ``Namespace completions`` () =
5454 async {
5555 use script = new FSharpScript()
56- let! completions = script.GetCompletionSymbols ( " System." , 1 , 7 )
57- let matchingCompletions = completions |> List .filter ( fun s -> s.DisplayName = " Collections" )
58- Assert.AreEqual( 1 , List.length matchingCompletions)
56+ let! completions = script.GetCompletionItems ( " System." , 1 , 7 )
57+ let matchingCompletions = completions |> Array .filter ( fun d -> d.Name = " Collections" )
58+ Assert.AreEqual( 1 , matchingCompletions.Length )
5959 } |> Async.StartAsTask :> Task
6060
6161 [<Test>]
@@ -65,7 +65,7 @@ type CompletionTests() =
6565 let lines = [ " open System.Linq"
6666 " let list = new System.Collections.Generic.List<int>()"
6767 " list." ]
68- let! completions = script.GetCompletionSymbols ( String.Join( " \n " , lines), 3 , 5 )
69- let matchingCompletions = completions |> List .filter ( fun s -> s.DisplayName = " Select" )
70- Assert.AreEqual( 1 , List.length matchingCompletions)
68+ let! completions = script.GetCompletionItems ( String.Join( " \n " , lines), 3 , 5 )
69+ let matchingCompletions = completions |> Array .filter ( fun d -> d.Name = " Select" )
70+ Assert.AreEqual( 1 , matchingCompletions.Length )
7171 } |> Async.StartAsTask :> Task
0 commit comments