| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
replace `n with [environment]::newline remove extra newline
|
We have many issues with these helper functions. Maybe put them in a temp module? This can simplify debugging and fixing. |
Sorry, something went wrong.
|
Ilya (@iSazonov) which helpers are you referring to? The tests don't really have any helpers? |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) I mean the formatting functions like Show-Error and Get-ConciseViewPositionMessage. |
Sorry, something went wrong.
There was a problem hiding this comment.
All this code seems pretty fragile and relies on the format of the error message which could change at any time. There's not much we can do about other that to rethink the whole error presentation which is probably not something we should entertain at the moment.
Sorry, something went wrong.
|
Ilya (@iSazonov) In 7.1, we'll have appropriate APIs for coloring/VT100, we can consider some refactoring then vs making a big change now |
Sorry, something went wrong.
|
🎉v7.0.0-rc.3 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
After the switch to use InvocationInfo.PositionMessage instead of crafting equivalent, the use of Trim() caused a mismatch between the line of script with the error and the underlining line so the line of code to insert VT100 color can be out of bounds. The whitespace at the beginning of the line causes this issue because Trim() makes the highlight line too short (previously the script line would also be trimmed).
Also fixed an issue where it was splitting PositionMessage by + to get the individual parts, but the message itself can contain a + so using newline instead. This with the trim is what caused the index to be out of bounds as the line is now too short to insert the VT100 code to reset the color back.
In addition, switched all use of `n to [Environment]::Newline.
Finally, removed an extra newline in the rendering.
PR Context
Fix #11669
PR Checklist