You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime
ParserError:
Line |
1 | $a=Get-Process -Id $PID | Format-List * | Out-Default | Select-String "Container" | 0/1
| ^
| Expressions are only allowed as the first element of a pipeline.
It may be worth considering also truncating lines longer than console width (adding ellipsis to indicate truncation) so that the relevant section is in the middle
When the position of the caret in the line is left of middle, I think it's better to have the message following the caret. However, I agree that when the caret is right of the middle, the wrapping makes it less pleasant. Perhaps one option is to use the middle to decide if the text should start on the next line?
Perhaps one option is to use the middle to decide if the text should start on the next line?
I'd prefer a simple rule that I proposed above. With more complex logic we will catch many bugs - console output is not easy to make reliable for all terminals and all use cases.
Note that with #11398, ConciseView now uses the pre-formatted PositionMessage which does truncation, so long lines will now be truncated. However, if the error is at the end of the line, then it's still not ideal:
Maybe you add another line here. Have the error position indicator on a line by itself (in red) and then on the next line always left justify the error message (in red)?
ParserError:
Line |
1 | $a=get-process -id $pid | format-list * | out-default | select-string "container" | 0/1
| -----^-----
| Expressions are only allowed as the first element of a pipeline.
Mocked up in notepad so I lost the coloring but you get the idea.
Or maybe:
ParserError:
Line |
1 | $a=get-process -id $pid | format-list * | out-default | select-string "container" | 0/1
| -----^-----
Expressions are only allowed as the first element of a pipeline.
Also that indicator would need to be adjusted for begining (or near beginning) of the line to something like ^----- and at the end maybe -----^. You could get rid of the ----- chars and use just ^ but that might be a bit hard to spot.
Since I was using the pre-rendered PositionMessage anyways for a different fix, it sort of made sense to just use it for this one. So now with the PR, it looks like:
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime
Activity
SteveL-MSFT commentedon Oct 10, 2019
It may be worth considering also truncating lines longer than console width (adding ellipsis to indicate truncation) so that the relevant section is in the middle
iSazonov commentedon Oct 10, 2019
Truncating error message? It makes it useless.
SteveL-MSFT commentedon Oct 10, 2019
In most of these cases, you would already have the line of code on your screen so not necessary to repeat it.
iSazonov commentedon Oct 11, 2019
My request is only about error message - to place it starting on new line.
iSazonov commentedon Nov 1, 2019
Steve Lee (@SteveL-MSFT) Can you make a conclusion about my last comment?
SteveL-MSFT commentedon Nov 1, 2019
cc Jason Helmick (@theJasonHelmick)
When the position of the caret in the line is left of middle, I think it's better to have the message following the caret. However, I agree that when the caret is right of the middle, the wrapping makes it less pleasant. Perhaps one option is to use the middle to decide if the text should start on the next line?
iSazonov commentedon Nov 1, 2019
I'd prefer a simple rule that I proposed above. With more complex logic we will catch many bugs - console output is not easy to make reliable for all terminals and all use cases.
SteveL-MSFT commentedon Nov 1, 2019
Would like to get some more feedback before making any change
SteveL-MSFT commentedon Dec 18, 2019
Note that with #11398, ConciseView now uses the pre-formatted PositionMessage which does truncation, so long lines will now be truncated. However, if the error is at the end of the line, then it's still not ideal:
rkeithhill commentedon Dec 18, 2019
Maybe you add another line here. Have the error position indicator on a line by itself (in red) and then on the next line always left justify the error message (in red)?
Mocked up in notepad so I lost the coloring but you get the idea.
Or maybe:
iSazonov commentedon Dec 18, 2019
First better.
rkeithhill commentedon Dec 18, 2019
Also that indicator would need to be adjusted for begining (or near beginning) of the line to something like
^-----and at the end maybe-----^. You could get rid of the-----chars and use just^but that might be a bit hard to spot.SteveL-MSFT commentedon Dec 18, 2019
Since I was using the pre-rendered PositionMessage anyways for a different fix, it sort of made sense to just use it for this one. So now with the PR, it looks like: