From 77e6f345eaabeede1cb6a619825c30f180f75066 Mon Sep 17 00:00:00 2001 From: Justin Grote Date: Thu, 5 Dec 2024 23:50:53 -0800 Subject: [PATCH] Try with update-help --- .../LanguageServerProtocolMessageTests.cs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs b/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs index d5f64bf1e..269732e32 100644 --- a/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs +++ b/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs @@ -1030,12 +1030,19 @@ await PsesLanguageClient }); } - [SkippableFact] + [Fact] public async Task CanSendCompletionAndCompletionResolveRequestAsync() { - Skip.If(IsLinux, "This depends on the help system, which is flaky on Linux."); - Skip.If(PsesStdioLanguageServerProcessHost.IsWindowsPowerShell, "This help system isn't updated in CI."); - string filePath = NewTestFile("Write-H"); + await PsesLanguageClient + .SendRequest( + "evaluate", + new EvaluateRequestArguments + { + Expression = "Update-Help Microsoft.Powershell.Utility;" + }) + .ReturningVoid(CancellationToken.None); + + string filePath = NewTestFile("Get-Date"); CompletionList completionItems = await PsesLanguageClient.TextDocument.RequestCompletion( new CompletionParams @@ -1054,10 +1061,10 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync() .SendRequest("completionItem/resolve", completionItem) .Returning(CancellationToken.None); - Assert.Contains("Writes customized output to a host", updatedCompletionItem.Documentation.String); + Assert.Contains("Gets the current date and time.", updatedCompletionItem.Documentation.String); } - [SkippableFact] + [Fact] public async Task CanSendCompletionResolveWithModulePrefixRequestAsync() { await PsesLanguageClient @@ -1065,7 +1072,7 @@ await PsesLanguageClient "evaluate", new EvaluateRequestArguments { - Expression = "Update-Help Microsoft.Powershell.Utility -Force;Import-Module Microsoft.PowerShell.Utility -Prefix Test -Force" + Expression = "Update-Help Microsoft.Powershell.Utility;Import-Module Microsoft.PowerShell.Utility -Prefix Test -Force" }) .ReturningVoid(CancellationToken.None);