Skip to content

Commit

Permalink
Merge pull request #685 from PowerShell/kapilmb/FixAvoidAliasCorrecti…
Browse files Browse the repository at this point in the history
…onExtent

Fix PSAvoidUsingAliases correction extent
  • Loading branch information
Kapil Borle authored Dec 19, 2016
2 parents dad50db + e5a8130 commit 59a1bfb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Rules/AvoidAlias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,21 @@ private IScriptExtent GetCommandExtent(CommandAst commandAst)
/// <returns>Retruns a list of suggested corrections</returns>
private List<CorrectionExtent> GetCorrectionExtent(CommandAst cmdAst, string cmdletName)
{
var ext = cmdAst.Extent;
var corrections = new List<CorrectionExtent>();
var alias = cmdAst.GetCommandName();
string description = string.Format(
var description = string.Format(
CultureInfo.CurrentCulture,
Strings.AvoidUsingCmdletAliasesCorrectionDescription,
alias,
cmdletName);
var cmdExtent = GetCommandExtent(cmdAst);
corrections.Add(new CorrectionExtent(
ext.StartLineNumber,
ext.EndLineNumber,
cmdAst.CommandElements[0].Extent.StartColumnNumber,
cmdAst.CommandElements[0].Extent.EndColumnNumber,
cmdExtent.StartLineNumber,
cmdExtent.EndLineNumber,
cmdExtent.StartColumnNumber,
cmdExtent.EndColumnNumber,
cmdletName,
ext.File,
cmdAst.Extent.File,
description));
return corrections;
}
Expand Down

0 comments on commit 59a1bfb

Please sign in to comment.