public async Task CanSendGetCommentHelpRequest() { string scriptPath = NewTestFile(@" function CanSendGetCommentHelpRequest { param( [string] $myParam ) } "); CommentHelpRequestResult commentHelpRequestResult = await LanguageClient.SendRequest <CommentHelpRequestResult>( "powerShell/getCommentHelp", new CommentHelpRequestParams { DocumentUri = new Uri(scriptPath).ToString(), BlockComment = false, TriggerPosition = new Position { Line = 0, Character = 0 } }); Assert.NotEmpty(commentHelpRequestResult.Content); Assert.Contains("myParam", commentHelpRequestResult.Content[7]); }
public async Task CanSendGetCommentHelpRequest() { string scriptPath = NewTestFile(@" function CanSendGetCommentHelpRequest { param( $myParam, $myOtherParam, $yetAnotherParam ) # Include other problematic code to make sure this still works gci } "); CommentHelpRequestResult commentHelpRequestResult = await LanguageClient.SendRequest <CommentHelpRequestResult>( "powerShell/getCommentHelp", new CommentHelpRequestParams { DocumentUri = new Uri(scriptPath).ToString(), BlockComment = false, TriggerPosition = new Position { Line = 0, Character = 0 } }); Assert.NotEmpty(commentHelpRequestResult.Content); Assert.Contains("myParam", commentHelpRequestResult.Content[7]); }
public async Task CanSendGetCommentHelpRequestAsync() { Skip.If( PsesStdioProcess.RunningInConstainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell, "Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load."); string scriptPath = NewTestFile(@" function CanSendGetCommentHelpRequest { param( $myParam, $myOtherParam, $yetAnotherParam ) # Include other problematic code to make sure this still works gci } "); CommentHelpRequestResult commentHelpRequestResult = await PsesLanguageClient .SendRequest <CommentHelpRequestParams>( "powerShell/getCommentHelp", new CommentHelpRequestParams { DocumentUri = new Uri(scriptPath).ToString(), BlockComment = false, TriggerPosition = new Position { Line = 0, Character = 0 } }) .Returning <CommentHelpRequestResult>(CancellationToken.None).ConfigureAwait(false); Assert.NotEmpty(commentHelpRequestResult.Content); Assert.Contains("myParam", commentHelpRequestResult.Content[7]); }