| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…wrongly associated to the LCurly of the one line if statement
Co-Authored-By: Robert Holt <rjmholt@gmail.com>
| Back | FazBrowse Home | New Git URL |
PR Summary
Fixes #1284
This fixes a bug (that must've been long-standing) in the GetBracePairs method (which returns all pairs of braces except for hashtables) of the TokenOperations class where it can wrongly pair an RBrace of an hashtable with the LCurly of a braced expression. This caused incorrect formatting of the script definition if ($true) { $test = @{ } } where the selected RBrace was the one of the hashtable and not the ifexpression, therefore leading to an incorrectly added newline before the final brace by the PSCloseBrace rule used by Invoke-Formatter (default rules settings are such that one-line expressions do not require a newline before the closing brace).
PR Checklist