-
Notifications
You must be signed in to change notification settings - Fork 498
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
Formatting no longer works #2543
Formatting no longer works #2543
Comments
Hi @motowilliams, can you please attach your logs as described in the last link in your issue description? |
Also your script that wasn't formatted correctly would also be hugely helpful. |
apologies if the format is incorrect. System Details Environment Details .code -v .code --list-extensions --show-versions .$psEditor.EditorServicesVersion .$PSVersionTable Issue Description Expected Behaviour Actual Behaviour Attached Logs any .ps1 file will do, here's one example; |
Aha - @elrod-johnson yours has something very interesting... a stack trace!
I'm very suspicious of the exclamation marks in the path... I need to do more testing.
@motowilliams logs didn't have anything useful, I'm afraid. Can you turn on Diagnostic logging and try again?
My guess is that you both are having the same issue though. |
i just tried formatting this file and saw the same response. i.e., no formatting. my powershell files have always been in e:\__FVHS\!!!!!\__Azure_AD_etc\_Powershell\ and they have formatted correctly prior to this latest update. |
Ok, that's useful information |
@elrod-johnson yes your logs now would be helpful! We'll be pushing an update to the preview version of the extension (next week likely) that has some more logging so we can better diagnose this issue. |
@motowilliams @elrod-johnson can you install this VSIX with the following steps:
I've added some logging here to give us a better idea of the specific issue that's occurring |
Can you all give the PowerShell Preview extension a try? We just did a release of it. Don't forget to disable the regular PowerShell extension for VS Code when you enable the PowerShell Preview extension for VS Code |
logs running ms-vscode.powershell-preview@2020.3.0 .code --list-extensions --show-versions a number of format attempts on several files, none succeeded thanks for working on it. |
@elrod-johnson can you try running the steps in #2543 (comment) as well. I put together the extension in that comment to log the formatting issue better so that we might be able to trace the null-ref exception |
here you go Tyler |
@elrod-johnson were you also able try running the steps in #2543 (comment)? |
@SydneyhSmith
regular Powershell ext was disabled for all of this 1584522859-b2c730ed-d03a-437d-a7f1-7d9e01abf0c11584522856881.zip |
Thanks @elrod-johnson! Unfortunately we still don't have enough information to determine an exact cause but it looks to be a race condition issue on the surface. We will have to do more investigation here, thanks again for all the info you have provided, we will update you when we have more steps to try! |
sorry, i was groggy this morning. here ya go. 1586485494-93ca9de9-3e8e-454f-a4a2-1d9eb8d5cd511586443543789.zip |
@elrod-johnson still not seeing the crash anymore... Can you elaborate on what you're seeing (or not seeing) when you run Format in VS Code? |
i tried to start over from scratch with the extension. vscode.powershell-preview_README.txt 1586509074-407a2197-18d8-4b06-a23b-bc3dac17cd971586509071629.zip |
@elrod-johnson from the logs you've sent me, it doesn't show that you ran the Formatter. Can you run it a few times in VS Code and attach those logs? Another thing, can you also try selecting all the text in your file and run the "Format Selection" command in VS Code? I'm curious if that behaves differently. Before you do this make sure you're still using the build I gave you. You can see the version number in the Extension pane. |
Once again thank you for going through this with me 😅 there was another person who opened a similar issue so I'm hoping they'll come over here to help as a tester for me as well |
i disabled extension auto-update after installing 1586603996-5f580f96-8801-43e7-a8ac-b8629678e0601586603598431.zip |
Ha! Today I learned that the text editor I use on my phone to open your logs cut out the content about half way 😅now on my laptop, I can see the crash perfectly. |
It looks like I was also groggy when I gave you that last build to try as I forgot to push my changes for more logging when I snapped a dev build to give you... 🤦♂️ This build has the logging in it: Thanks for your patience, @elrod-johnson |
this log is using 1586682518-cdf71ef4-4bb7-4057-8aad-e422c88775921586682515734.zip |
Ok @elrod-johnson nothing useful in that... how about this one? I've basically added line-by-line logging (nothing sensitive just a bunch of null checks). Keep in mind, the vsix's name is now:
|
attached the two scripts i tried to format. 1587017167-4fd38891-1e6a-4d96-b2c2-43c721cc30991587017164072.zip |
@elrod-johnson that put the pieces all together for me... here's what was happening... you had this setting:
this disables PSScriptAnalyzer capabilities in the extension including:
Since that was off, formatting wasn't working. With that said, I don't see why this needs to be the case. You should be able to run the formatter and have "Problems" turned off. I think I have an idea for a fix and will report back. |
@elrod-johnson I think this build might just fix your problem 😄 please let me know! |
sure looks fixed to me guys! thanks a lot for staying on this for so long. |
Glad to hear @elrod-johnson ! This will probably be in the PowerShell Preview extension next week so you'll be able to update to that then. My guess is that this well make it into Stable probably in a few weeks. |
System Details
System Details Output
Issue Description
Latest version of extension no longer formats scripts
Expected Behaviour
It should format the script like it has forever.
Actual Behaviour
Nothing happens
Attached Logs
Follow the instructions in the troubleshooting docs
about capturing and sending logs.
1583792484-d9b584fd-a4f6-4b7e-9d35-4bec4545762c1583792481203.zip
Copy-ReleaseVariablesToVariableGroup.zip
The text was updated successfully, but these errors were encountered: