-
Notifications
You must be signed in to change notification settings - Fork 318
Implement dynamic help for full help and parameter help #1777
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
73fbf78
Full help and parameter help working
adityapatwardhan dbc1e53
Scroll to parameter name for full help
adityapatwardhan 7cdd0ce
Remove abstract class and bug fixes
adityapatwardhan cb02124
Refactor
adityapatwardhan 9bef595
Refactor helper methods to parent class
adityapatwardhan f9a5920
Add resource string for missing help content
adityapatwardhan 66db469
Address feedback
adityapatwardhan 3430b9d
Added empty line at the end of file
adityapatwardhan 4d9cb1e
More refactoring
adityapatwardhan bc42a76
Add mockable API
adityapatwardhan 1ddf423
Partial tests
adityapatwardhan def4ca3
Move to PowerShell SDK 7.1.0
adityapatwardhan 4a09baf
Refactor and add tests
adityapatwardhan 65ff765
Add tests for error message
adityapatwardhan 492bcbd
Address code review comments
adityapatwardhan 28acebf
Address code review feedback
adityapatwardhan 4f69fd6
Add error message for legacy console
adityapatwardhan cb605e0
Address more feedback
adityapatwardhan fc817c6
Add tests for two full lines and change keys
adityapatwardhan 024043d
Address feedback
adityapatwardhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/********************************************************************++ | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
--********************************************************************/ | ||
|
||
using System; | ||
using Microsoft.PowerShell.Internal; | ||
adityapatwardhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
namespace Microsoft.PowerShell | ||
{ | ||
public partial class PSConsoleReadLine | ||
{ | ||
private class DisplayBlockBase | ||
{ | ||
internal PSConsoleReadLine Singleton; | ||
internal int Top; | ||
|
||
protected void MoveCursorDown(int cnt) | ||
{ | ||
IConsole console = Singleton._console; | ||
while (cnt-- > 0) | ||
{ | ||
console.Write("\n"); | ||
} | ||
} | ||
|
||
protected void AdjustForPossibleScroll(int cnt) | ||
{ | ||
IConsole console = Singleton._console; | ||
var scrollCnt = console.CursorTop + cnt + 1 - console.BufferHeight; | ||
if (scrollCnt > 0) | ||
{ | ||
Top -= scrollCnt; | ||
_singleton._initialY -= scrollCnt; | ||
_savedCursorTop -= scrollCnt; | ||
} | ||
} | ||
|
||
private int _savedCursorLeft; | ||
private int _savedCursorTop; | ||
|
||
public void SaveCursor() | ||
{ | ||
IConsole console = Singleton._console; | ||
_savedCursorLeft = console.CursorLeft; | ||
_savedCursorTop = console.CursorTop; | ||
} | ||
|
||
public void RestoreCursor() => Singleton._console.SetCursorPosition(_savedCursorLeft, _savedCursorTop); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.