Open rjmholt opened 5 years ago
From @rkeithhill on December 14, 2018 0:40
Document formatting is provided by the PowerShell ScriptAnalyzer. @rjmholt Do you have perms to move this issue to the PSSA repo?
No, sorry. I'll do it the old way
Thanks for logging this issue, looks interesting, I will take a look at it this weekend or next week. P.S. For repro-ing PSSA formatting bugs, I suggest to use Invoke-Formatter
directly the next time because you can pass settings, which is what I'll first to find out which rule is causing it.
From @sk82jack on December 14, 2018 0:20
System Details
System Details Output
Issue Description
When running format document on a script it is converting an ISO 8601 timestamp within a string to a more human-readable string.
The issue has been reproduced by someone in the PowerShell slack and if you want to try and reproduce it yourself then feel free. Script here https://github.com/sk82jack/PSFPL/blob/master/Tests/Private/ConvertTo-FplObject.Tests.ps1#L48
I am trying to copy the timestamp string from line 67 into line 48
Expected Behaviour
I'd expect text in quotes to not be altered.
Actual Behaviour
Probably best described by a gif:
Once it converts it it then starts being weird and reporting errors that weren't reported before:
So, if I Ctrl+Z and then format again and then it doesn't convert it but it does remove the single quote from the end of line 48. I think that must be related to the previously reported errors but it still reports errors after removing the quote:
So, I Ctrl+Z again and try and format again but the integrated console usually crashes at this point.
Attached Logs
VSCodeDiagnosticLogs.zip
Copied from original issue: PowerShell/vscode-powershell#1657