@@ -41,7 +41,7 @@ public void Dispose()
41
41
42
42
private ScriptFile GetScriptFile ( ScriptRegion scriptRegion ) => workspace . GetFile ( TestUtilities . GetSharedPath ( scriptRegion . File ) ) ;
43
43
44
- private Task < IEnumerable < CompletionItem > > GetCompletionResultsAsync ( ScriptRegion scriptRegion )
44
+ private Task < CompletionResults > GetCompletionResultsAsync ( ScriptRegion scriptRegion )
45
45
{
46
46
return completionHandler . GetCompletionsInFileAsync (
47
47
GetScriptFile ( scriptRegion ) ,
@@ -53,15 +53,15 @@ private Task<IEnumerable<CompletionItem>> GetCompletionResultsAsync(ScriptRegion
53
53
[ Fact ]
54
54
public async Task CompletesCommandInFile ( )
55
55
{
56
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteCommandInFile . SourceDetails ) . ConfigureAwait ( true ) ;
56
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteCommandInFile . SourceDetails ) . ConfigureAwait ( true ) ;
57
57
CompletionItem actual = Assert . Single ( results ) ;
58
58
Assert . Equal ( CompleteCommandInFile . ExpectedCompletion , actual ) ;
59
59
}
60
60
61
61
[ Fact ]
62
62
public async Task CompletesCommandFromModule ( )
63
63
{
64
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteCommandFromModule . SourceDetails ) . ConfigureAwait ( true ) ;
64
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteCommandFromModule . SourceDetails ) . ConfigureAwait ( true ) ;
65
65
CompletionItem actual = Assert . Single ( results ) ;
66
66
// NOTE: The tooltip varies across PowerShell and OS versions, so we ignore it.
67
67
Assert . Equal ( CompleteCommandFromModule . ExpectedCompletion , actual with { Detail = "" } ) ;
@@ -71,7 +71,7 @@ public async Task CompletesCommandFromModule()
71
71
[ Fact ]
72
72
public async Task CompletesTypeName ( )
73
73
{
74
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteTypeName . SourceDetails ) . ConfigureAwait ( true ) ;
74
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteTypeName . SourceDetails ) . ConfigureAwait ( true ) ;
75
75
CompletionItem actual = Assert . Single ( results ) ;
76
76
if ( VersionUtils . IsNetCore )
77
77
{
@@ -92,23 +92,23 @@ public async Task CompletesTypeName()
92
92
[ Fact ]
93
93
public async Task CompletesNamespace ( )
94
94
{
95
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteNamespace . SourceDetails ) . ConfigureAwait ( true ) ;
95
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteNamespace . SourceDetails ) . ConfigureAwait ( true ) ;
96
96
CompletionItem actual = Assert . Single ( results ) ;
97
97
Assert . Equal ( CompleteNamespace . ExpectedCompletion , actual ) ;
98
98
}
99
99
100
100
[ Fact ]
101
101
public async Task CompletesVariableInFile ( )
102
102
{
103
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteVariableInFile . SourceDetails ) . ConfigureAwait ( true ) ;
103
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteVariableInFile . SourceDetails ) . ConfigureAwait ( true ) ;
104
104
CompletionItem actual = Assert . Single ( results ) ;
105
105
Assert . Equal ( CompleteVariableInFile . ExpectedCompletion , actual ) ;
106
106
}
107
107
108
108
[ Fact ]
109
109
public async Task CompletesAttributeValue ( )
110
110
{
111
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteAttributeValue . SourceDetails ) . ConfigureAwait ( true ) ;
111
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteAttributeValue . SourceDetails ) . ConfigureAwait ( true ) ;
112
112
Assert . Collection ( results . OrderBy ( c => c . SortText ) ,
113
113
actual => Assert . Equal ( actual , CompleteAttributeValue . ExpectedCompletion1 ) ,
114
114
actual => Assert . Equal ( actual , CompleteAttributeValue . ExpectedCompletion2 ) ,
@@ -118,7 +118,7 @@ public async Task CompletesAttributeValue()
118
118
[ Fact ]
119
119
public async Task CompletesFilePath ( )
120
120
{
121
- IEnumerable < CompletionItem > results = await GetCompletionResultsAsync ( CompleteFilePath . SourceDetails ) . ConfigureAwait ( true ) ;
121
+ ( _ , IEnumerable < CompletionItem > results ) = await GetCompletionResultsAsync ( CompleteFilePath . SourceDetails ) . ConfigureAwait ( true ) ;
122
122
Assert . NotEmpty ( results ) ;
123
123
CompletionItem actual = results . First ( ) ;
124
124
// Paths are system dependent so we ignore the text and just check the type and range.
0 commit comments