@@ -1030,12 +1030,19 @@ await PsesLanguageClient
1030
1030
} ) ;
1031
1031
}
1032
1032
1033
- [ SkippableFact ]
1033
+ [ Fact ]
1034
1034
public async Task CanSendCompletionAndCompletionResolveRequestAsync ( )
1035
1035
{
1036
- Skip . If ( IsLinux , "This depends on the help system, which is flaky on Linux." ) ;
1037
- Skip . If ( PsesStdioLanguageServerProcessHost . IsWindowsPowerShell , "This help system isn't updated in CI." ) ;
1038
- string filePath = NewTestFile ( "Write-H" ) ;
1036
+ await PsesLanguageClient
1037
+ . SendRequest (
1038
+ "evaluate" ,
1039
+ new EvaluateRequestArguments
1040
+ {
1041
+ Expression = $ "Update-Help Microsoft.Powershell.Utility -SourcePath { s_binDir } ;"
1042
+ } )
1043
+ . ReturningVoid ( CancellationToken . None ) ;
1044
+
1045
+ string filePath = NewTestFile ( "Get-Date" ) ;
1039
1046
1040
1047
CompletionList completionItems = await PsesLanguageClient . TextDocument . RequestCompletion (
1041
1048
new CompletionParams
@@ -1048,28 +1055,28 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
1048
1055
} ) ;
1049
1056
1050
1057
CompletionItem completionItem = Assert . Single ( completionItems ,
1051
- completionItem1 => completionItem1 . FilterText == "Write-Host " ) ;
1058
+ completionItem1 => completionItem1 . FilterText == "Get-Date " ) ;
1052
1059
1053
1060
CompletionItem updatedCompletionItem = await PsesLanguageClient
1054
1061
. SendRequest ( "completionItem/resolve" , completionItem )
1055
1062
. Returning < CompletionItem > ( CancellationToken . None ) ;
1056
1063
1057
- Assert . Contains ( "Writes customized output to a host " , updatedCompletionItem . Documentation . String ) ;
1064
+ Assert . Contains ( "Gets the current date and time. " , updatedCompletionItem . Documentation . String ) ;
1058
1065
}
1059
1066
1060
- [ SkippableFact ( Skip = "Completion for Expand-SlowArchive is flaky." ) ]
1067
+ [ Fact ]
1061
1068
public async Task CanSendCompletionResolveWithModulePrefixRequestAsync ( )
1062
1069
{
1063
1070
await PsesLanguageClient
1064
1071
. SendRequest (
1065
1072
"evaluate" ,
1066
1073
new EvaluateRequestArguments
1067
1074
{
1068
- Expression = " Import-Module Microsoft.PowerShell.Archive -Prefix Slow "
1075
+ Expression = $ "Update-Help Microsoft.Powershell.Utility -SourcePath { s_binDir } ; Import-Module Microsoft.PowerShell.Utility -Prefix Test -Force "
1069
1076
} )
1070
1077
. ReturningVoid ( CancellationToken . None ) ;
1071
1078
1072
- string filePath = NewTestFile ( "Expand-SlowArch " ) ;
1079
+ string filePath = NewTestFile ( "Get-TestDate " ) ;
1073
1080
1074
1081
CompletionList completionItems = await PsesLanguageClient . TextDocument . RequestCompletion (
1075
1082
new CompletionParams
@@ -1078,17 +1085,15 @@ await PsesLanguageClient
1078
1085
{
1079
1086
Uri = DocumentUri . FromFileSystemPath ( filePath )
1080
1087
} ,
1081
- Position = new Position ( line : 0 , character : 15 )
1088
+ Position = new Position ( line : 0 , character : 12 )
1082
1089
} ) ;
1083
1090
1084
1091
CompletionItem completionItem = Assert . Single ( completionItems ,
1085
- completionItem1 => completionItem1 . Label == "Expand-SlowArchive " ) ;
1092
+ completionItem1 => completionItem1 . Label == "Get-TestDate " ) ;
1086
1093
1087
- CompletionItem updatedCompletionItem = await PsesLanguageClient
1088
- . SendRequest ( "completionItem/resolve" , completionItem )
1089
- . Returning < CompletionItem > ( CancellationToken . None ) ;
1094
+ CompletionItem updatedCompletionItem = await PsesLanguageClient . ResolveCompletion ( completionItem ) ;
1090
1095
1091
- Assert . Contains ( "Extracts files from a specified archive " , updatedCompletionItem . Documentation . String ) ;
1096
+ Assert . Contains ( "Gets the current date and time. " , updatedCompletionItem . Documentation . String ) ;
1092
1097
}
1093
1098
1094
1099
[ SkippableFact ]
@@ -1123,22 +1128,21 @@ public async Task CanSendSignatureHelpRequestAsync()
1123
1128
{
1124
1129
string filePath = NewTestFile ( "Get-Date -" ) ;
1125
1130
1126
- SignatureHelp signatureHelp = await PsesLanguageClient
1127
- . SendRequest (
1128
- "textDocument/signatureHelp" ,
1129
- new SignatureHelpParams
1131
+ SignatureHelp signatureHelp = await PsesLanguageClient . RequestSignatureHelp
1132
+ (
1133
+ new SignatureHelpParams
1134
+ {
1135
+ TextDocument = new TextDocumentIdentifier
1130
1136
{
1131
- TextDocument = new TextDocumentIdentifier
1132
- {
1133
- Uri = new Uri ( filePath )
1134
- } ,
1135
- Position = new Position
1136
- {
1137
- Line = 0 ,
1138
- Character = 10
1139
- }
1140
- } )
1141
- . Returning < SignatureHelp > ( CancellationToken . None ) ;
1137
+ Uri = new Uri ( filePath )
1138
+ } ,
1139
+ Position = new Position
1140
+ {
1141
+ Line = 0 ,
1142
+ Character = 10
1143
+ }
1144
+ }
1145
+ ) ;
1142
1146
1143
1147
Assert . Contains ( "Get-Date" , signatureHelp . Signatures . First ( ) . Label ) ;
1144
1148
}
@@ -1231,7 +1235,7 @@ await PsesLanguageClient
1231
1235
Assert . Equal ( 0 , evaluateResponseBody . VariablesReference ) ;
1232
1236
}
1233
1237
1234
- [ Fact ]
1238
+ [ Fact ( Timeout = 60000 ) ]
1235
1239
public async Task CanSendGetCommandRequestAsync ( )
1236
1240
{
1237
1241
List < object > pSCommandMessages =
0 commit comments