Skip to content

Refactor GetCommandSynopsisAsync method make sure cmdlets with module prefixes work #1243

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

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Mar 26, 2020

Fixes #1242
Fixes PowerShell/vscode-powershell#2584

This method needed a good refactor... The main change here is:

.AddParameter("Name", commandInfo.Name)

instead of

.AddArgument(commandInfo)

because commandInfo.ToString() gives you duplicate Prefixes... I'll link that PowerShell/PowerShell issue here when the original filer opens it.

@TylerLeonhardt TylerLeonhardt requested a review from rjmholt as a code owner March 26, 2020 18:02
@@ -76,36 +76,36 @@ static CommandHelpers()
CommandInfo commandInfo,
PowerShellContextService powerShellContext)
{
Validate.IsNotNull(nameof(commandInfo), commandInfo);
Copy link
Member Author

Choose a reason for hiding this comment

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

added this since all references checked commandInfo != null already

@TylerLeonhardt TylerLeonhardt force-pushed the fix-commands-with-prefix branch from e0813e0 to 774c241 Compare March 26, 2020 19:05
@TylerLeonhardt
Copy link
Member Author

Codacy Here is an overview of what got changed by this pull request:

Complexity decreasing per file
==============================
+ src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs  -1
         

See the complete overview on Codacy

@TylerLeonhardt TylerLeonhardt merged commit 4157a91 into PowerShell:master Mar 26, 2020
@TylerLeonhardt TylerLeonhardt deleted the fix-commands-with-prefix branch March 26, 2020 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants