Skip to content
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

The explanation of the range operator seem not correct #85

Closed
LaurentDardenne opened this issue Jul 1, 2022 · 1 comment
Closed

The explanation of the range operator seem not correct #85

LaurentDardenne opened this issue Jul 1, 2022 · 1 comment
Labels
good first issue Good for newcomers

Comments

@LaurentDardenne
Copy link

With

$T=(1..5),(6..10)

image

I dont understand : The range operator '..'. This works from left to right, so targeting '10'

Note, since PS v6:

"A".."Z"

The range operator '..'. This works from left to right, so targeting '"Z"'

@LaurentDardenne LaurentDardenne changed the title The exaplanation the range operator seem not correct The explanation the range operator seem not correct Jul 1, 2022
@LaurentDardenne LaurentDardenne changed the title The explanation the range operator seem not correct The explanation of the range operator seem not correct Jul 1, 2022
@Jawz84
Copy link
Owner

Jawz84 commented Jul 1, 2022

Oof I agree, this looks ugly. I introduced this myself in #79, while working on #78 and #77.

Maybe we should change this here:

DotDot;33;The range operator '..'.;about_Operators

And adapt the code here:

public override AstVisitAction VisitBinaryExpression(BinaryExpressionAst binaryExpressionAst)
{
var (tokenDescription, helpQuery) = Helpers.TokenExplainer(binaryExpressionAst.Operator);
helpQuery ??= "about_operators";
var helpResult = HelpTableQuery(helpQuery);
explanations.Add(
new Explanation()
{
CommandName = "Operator",
HelpResult = helpResult,
Description = $"{tokenDescription} This works from left to right, so targeting '{binaryExpressionAst.Right.Extent.Text}'",
TextToHighlight = binaryExpressionAst.Operator.Text()
}.AddDefaults(binaryExpressionAst, explanations));
return AstVisitAction.Continue;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants