-
Notifications
You must be signed in to change notification settings - Fork 513
PowerShell Integrated Console (PSIC) is not created on VSCode startup #2900
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
@pcgeek86 can you please share your vscode settings here? |
I believe this is a question of VSCode activating the PowerShell extension, which is configured by the extension's declared activation events. I think these are static for the extension, and not configurable on a user basis. Meaning any configuration for this that the extension ships would apply to all users. Here are the currently configured activation events: vscode-powershell/package.json Lines 30 to 49 in a150199
That's:
The remaining events that might help here are:
The ideal solution I think would be a VSCode setting to start listed extensions at startup. We would need to ask for that in the VSCode repo. |
Here's my VSCode settings.
|
@rjmholt But when I do a |
In case it matters, the PowerShell file that I have opened up is being saved using the VSCode persistence mechanism. I don't know the details of how that feature is implemented. The script file has not been saved to disk. Perhaps that is why PSIC isn't being activated? EDIT: Saved file to disk, reloaded VSCode window, and PSIC still isn't starting up, even though |
@pcgeek86 do you have any workspace-level settings? |
@pcgeek86 your video doesn't show the crucial part where VSCode and the first script file are opened. Nothing works from that point because there's no PowerShell session (hence no PSIC). But the question is why is there no PSIC initially. We need further information about that point where the first file is opened to find out why the PowerShell extension isn't being triggered. |
@TylerLeonhardt No workspace-level settings. @rjmholt The video shows me doing a "reload window" at 1:00. |
@pcgeek86 get rid of this setting:
does that change anything? |
@TylerLeonhardt Yes, that solves it. I can't remember why I added that in there, a long while back. Probably because there are duplicate PowerShell terminals, that makes VSCode a little more confusing. Is there some way for the extension to piggy back on the |
It's not possible. That terminal is created by VS Code and not the extension. We've thought about killing that terminal at start up, but if the user has important info there (like they ran a command), then we would cause them harm. |
It seems like a bug that completions don't occur if the PSIC isn't visible though. I wonder what causes that.
To do that, the extension client would need to find that PowerShell process and inject the server into it. In general with other processes, that's not possible, but PowerShell does listen for |
Uh oh!
There was an error while loading. Please reload this page.
System Details Output
Issue Description
I was trying to debug the root cause for Intellisense not working in the VSCode-PowerShell extension, when I came across the following error message in the
vscode-powershell.log
file, in my diagnostic logs folder.I had to create a dummy script, use F5 to run that, and then the PSIC got created. Suddenly, Intellisense for third-party modules / objects started working again.
Question: Is there some way to ensure that PSIC is always spun up when VSCode is re-launched, when a PowerShell script file is opened up? I wonder if this is partly why people are having so many problems with broken Intellisense.
Expected Behaviour
Intellisense works at startup
Actual Behaviour
Intellisense for third-party entities (modules, .NET libraries, etc.) doesn't work on VSCode startup.
Known Work-around
F5
to invoke the dummy scriptRelated Issues
#2745
There are only two mentions of the exact log message that I pasted above, but neither one seems to address the PSIC not being created at startup time.
The text was updated successfully, but these errors were encountered: