-
Notifications
You must be signed in to change notification settings - Fork 237
Change Get-Help behavior to return local help when no online help available #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c35d13e
75f8afb
55936d1
6ad4e91
51a2ae8
0f65dc6
74f04ff
c772aa0
4090e8e
c481d02
d125d66
f100131
c2ba5ad
504a5a8
004d53d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,6 +231,7 @@ await requestContext.SendResult( | |
} | ||
}); | ||
} | ||
|
||
protected async Task HandleShowHelpRequest( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: newline between functions |
||
string helpParams, | ||
RequestContext<object> requestContext) | ||
|
@@ -263,10 +264,9 @@ protected async Task HandleShowOnlineHelpRequest( | |
RequestContext<object> requestContext | ||
) | ||
{ | ||
const string deprecatedWarning = @" | ||
Write-Warning ""'powerShell/showOnlineHelp' has been deprecated. Use 'powerShell/showHelp' instead."""; | ||
PSCommand commandDeprecated = new PSCommand() | ||
.AddScript(deprecatedWarning); | ||
.AddCommand("Microsoft.PowerShell.Utility\\Write-Verbose") | ||
.AddParameter("Message", ";powerShell/showOnlineHelp' has been deprecated. Use 'powerShell/showHelp' instead."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo here I think (from ; to ') |
||
await editorSession.PowerShellContext.ExecuteCommand<PSObject>(commandDeprecated, sendOutputToHost: true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of (or in addition to) a PSIC warning, we could log a warning to the log file. I could go either way on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The ideal would be to launch a popup. But that would be a lot for this PR. Perhaps instead we can leave it as a PSIC message and open an issue to make a popup? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a newline above this |
||
await this.HandleShowHelpRequest(helpParams, requestContext); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a newline here?