Skip to content

Conversation

@sethvs
Copy link
Contributor

@sethvs sethvs commented Jul 26, 2018

Change parameters order in Get-Help cmdlet and help function in order to get first -Full and then -Functionality when using Get-Help -Fu<tab> and help -Fu<tab>.

Since -Full parameter is used much more frequently, than -Functionality it make sense to put it first when using tab completion.

Also, alphabetically, Full goes earlier than Functionality, that adds to the justification of the change.

Fix #7371

PR Summary

PR Checklist

…ull and then -Functionality when using Get-Help -Fu<tab> and help -Fu<tab>.
/// </summary>
/// <value></value>
[Parameter]
public string[] Component { get; set; } = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove initialization - null is default. Below too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/// <summary>
/// List of Component's to search on.
/// </summary>
/// <value></value>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove line /// <value></value>. Below too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

public string Parameter { set; get; }

/// <summary>
/// List of Component's to search on.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public comment for property should start with "Gets and sets ...". Below too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


It 'Should first suggest -Full and then -Functionalty when using Get-Help -Fu<tab>' -skip {
$res = TabExpansion2 -inputScript 'Get-Help -Fu' -cursorColumn 'Get-Help -Fu'.Length
$res.CompletionMatches[0].CompletionText | Should -Be '-Full'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use -BeExactly for strings. Below too.

@iSazonov iSazonov self-assigned this Jul 26, 2018
$res.CompletionMatches[1].CompletionText | Should -Be '-Functionality'
}

It 'Should first suggest -Full and then -Functionalty when using help -Fu<tab>' -skip {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo (missing i): Functionalty -> Functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

$res.CompletionMatches[0].CompletionText | Should -Be 'namespace'
}

It 'Should first suggest -Full and then -Functionalty when using Get-Help -Fu<tab>' -skip {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo (missing i): Functionalty -> Functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mklement0
Copy link
Contributor

Please see #7371 (comment) for why I think this problem should be tackled fundamentally differently.

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know when we will have a more general solution and so far this is LGTM.

@mklement0
Copy link
Contributor

@iSazonov: Understood, but my point was that the effort expended here could have gone toward fixing the problem fundamentally.

@iSazonov
Copy link
Collaborator

@mklement0 I agree. And this is a very simple change. I think we will not be able to implement a more general solution until 6.1. So this decision will be welcome since it should not contradict a more general solution.

@iSazonov iSazonov requested a review from SteveL-MSFT July 31, 2018 04:35
@iSazonov
Copy link
Collaborator

@SteveL-MSFT Do you agree to merge the intermediate change?

@SteveL-MSFT
Copy link
Member

I'm fine taking this change as-is. @mklement0 Perhaps you can open a new issue to discuss the broader issue?

@iSazonov iSazonov merged commit 740d059 into PowerShell:master Jul 31, 2018
@sethvs sethvs deleted the full branch September 27, 2018 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the order that -Full and -Functionality parameters of the Get-Help cmdlet show up when using Tab completion.

4 participants