Skip to content

Commit

Permalink
Try with update-help
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed Dec 6, 2024
1 parent e1cd3c4 commit 77e6f34
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1054,18 +1061,18 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
.SendRequest("completionItem/resolve", completionItem)
.Returning<CompletionItem>(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
.SendRequest(
"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);

Expand Down

0 comments on commit 77e6f34

Please sign in to comment.