-
Notifications
You must be signed in to change notification settings - Fork 510
Extension crashes with ParseError: The '<' operator is reserved for future use #2780
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
Comments
From your logs it looks like you're using the .NET Global Tool. What version of the .NET Global Tool do you have installed?
|
Correct, here's the output from
|
Thanks @ohadschn does this reproduce if you use another version of PowerShell rather than the dot net global tool, to set your default PowerShell version use: |
Thank you, unfortunately it still reproduces with that setting (restarted vscode) |
Thanks @ohadschn sorry to hear that this issue is still reproducing, what installation method did you use for PowerShell preview? |
I'm not sure I follow, I don't have PowerShell preview installed as far as I know. |
@ohadschn sorry that was totally my bad, I forgot to update the snippet I sent you, that would work (ie. installing PowerShell preview first) or if you are running on Windows you could instead try: |
No worries, I definitely share the blame for blindly copy-pasting. I am indeed running on Windows, and the new setting ( However that gives me PS 5.1 while I need PS Core (7), and reverting the above config change unfortunately reproduces the problem... Does that mean I need to uninstall the .NET global tool and install the "regular" MSI package? |
This seems likely at this point... can you give it a try? I'd like to get to the bottom of why the Global Tool isn't working for you... is your computer's language set to something that isn't english? Do you use a different keyboard layout? (just shots in the dark... I should probably go try the global tool myself...) FWIW, the MSI is faster than the Global Tool so frankly I recommend the MSI anyway. |
Thanks, I can confirm .NET tool uninstall + install regular PS MSI works! Sure is good enough for me, but I do like the global tool approach because it's basically a package manager - not crazy about going off to download MSIs every time a new version comes out... When WinGet is GA I guess that won't be an issue though (assuming this behavior doesn't reproduce there of course). As for my setup, pretty straightforward - display language is English, preferred language it English (I do have Hebrew installed alongside it but it never caused any issue AFAIK). English keyboard layout is standard US QWERTY... |
Cc @adityapatwardhan about global tool. @ohadschn There's also a setting to suppress the startup banner... I wonder if that would fix the issue. I have doubt, but it might. Not sure what it is off the top of my head. |
@TylerLeonhardt the setting is: But the extension then proceeds with another series of unclear errors (the script executes fine outside VS Code):
|
(I seemingly cannot add a newline after a code block in my previous comment) @TylerLeonhardt as an update, when I downgrade to Edit: I have PS 7.0.2 installed through the MSI on Github, as well as the Global Tool 7.0.2. |
This is strange. It sounds like needed modules might not be imported. Perhaps your profile sets the PSModulePath? The banner issue looks like the argument to set the banner hasn't been quoted/escaped properly. If this is dotnet global tool specific, then it may be due to dotnet having some expectation about how parameters are passed. There are several layers to pass parameters through there and this gets pretty dicey. |
I'm able to reproduce this issue. I'll see if I can take a look at some point. Currently working on several things already, but hopefully I can find some time this week |
If I start the extension with load profile disabled ( |
@JosKrause PSVersion 7.1.0 And the v2020.6.0 of the PowerShell extension. |
@rjmholt could you re-open this? I'm seeing what appears to be the same issue using the latest extension (v2020.6.0) and PS Core 7.1.1 installed as a global tool (setting |
@ohadschn Try PowerShell 7.1.3, we don't think the fix was in 7.1.1. |
@andschwa looks good, thanks! |
Issue Description
Whenever I open a PowerShell file (
ps1
/psm1
) the extension crashes like so:I tried the following to no effect:
Attached Logs
It looks like the
<
in theStartupBanner
is causing the issueEnvironment Information
Visual Studio Code
PowerShell Information
I don't know why 5.1 is loaded - I have the latest PowerShell Core (7.0.02) installed and working (e.g. in Windows Terminal).
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: