-
Notifications
You must be signed in to change notification settings - Fork 511
Powershell extension never completes initializing... #4720
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
Thanks @benpxs and thanks for providing the detailed log info-- super helpful! Have you ever had success with the extension or have you always hit this issue? |
@benpxs do you have the rest of the PowerShell Editor Services log (the one with the warning about "Tried to send request or notification before initialization was completed and will be sent later"), or any of the JSON payload? As far as I can tell it is stuck in the call to the LSP client library's start function...which we don't implement, it comes from the VS Code library. So I'm trying to figure out what else might be going on. |
Also, we have a theory that perhaps it's stuck loading your profiles. You could confirm this for us pretty easily by trying to repro with the extension setting |
Thanks for the replies all. @andyleejordan : setting [Warn - 8:29:15 AM] OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.RequestCancelled | @request='OmniSharp.Extensions.JsonRpc.RequestCancelled' If you need the JSON payload, I'll need a bit of help in finding that? |
@benpxs have you been able to teste this with the pre-release extension? Here's a more direct link to the section about getting the JSON payload: https://github.com/PowerShell/vscode-powershell/blob/main/docs/troubleshooting.md#provide-language-server-protocol-payload-logs, it's under "Provide Language Server Protocol payload logs." Thanks! |
Another question: do you have oh-my-posh or anything similar enabled? That seems to cause problems because of the handlers it adds to PSReadLine. |
@andyleejordan - nope, no other PS related add-on enabled. I have settings sync configured and my other (home) pc it works just fine (its a new build). I've tried removing the extension, the files and so (even vsc), but no mater what I delete, it remains in the same state (I guess I am missing something I should delete). |
This issue has been labeled as needing feedback and has not had any activity for one or more weeks. It has been closed for housekeeping purposes. |
I was having the same issues, and after playing with the settings, I came to the conclusion that the issue is somehow related to using a custom PowerShell installation folder. I'm using Scoop as a package manager, and PowerShell 7 is installed with it. In my VSCode config, I set "terminal.integrated.profiles.windows": {
"PowerShell 7": {
"path": "${env:userprofile}\\scoop\\apps\\pwsh\\current\\pwsh.exe"
}
} If I add a custom PowerShell exe path and select it as the default PowerShell version, the extension starts working again. Something like this: "powershell.powerShellAdditionalExePaths": {
"pwsh": "c:\\Users\\<username>\\scoop\\apps\\pwsh\\current\\pwsh.exe"
},
"powershell.powerShellDefaultVersion": "pwsh" Previously, it was working without these modifications, but I'm just happy it works now. :) |
No idea why the bot messed up there, but question: are you using the Windows Store installed PowerShell? |
This issue has been labeled as needing feedback and has not had any activity for one or more weeks. It has been closed for housekeeping purposes. |
@andyleejordan What if you are using oh-my-posh? Is there a workaround? I tried disabling loading my profile, but it seems to have the issue still. I also updated PSReadline, which made everything way faster, but the issue still exists. |
@peterlobster could you open a new issue and go through the template's steps of adding logs so we can help you better? |
Prerequisites
Summary
When starting a intergrated terminal session the extension never finishes initializing. I can use powershell outside of this terminal but without intellisense/formatting etc.
The terminial info 'hover' window shows:
PowerShell
ExtensionProcess ID (PID): 16672
Command line: C:\Program Files\PowerShell\7\pwsh.exe '-NoProfile' '-ExecutionPolicy' 'Bypass' '-Command' 'Import-Module 'c:\Users<user>.vscode\extensions\ms-vscode.powershell-2023.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users<user>.vscode\extensions\ms-vscode.powershell-2023.6.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.6.0 Copyright (c) Microsoft Corporation.
https://aka.ms/vscode-powershell Type 'help' to get help. " -LogLevel 'Normal' -LogPath 'c:\Users<user>\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1693824471-40f1424a-a573-4b8a-bfc7-992a1b203df51693824469438\EditorServices.log' -SessionDetailsPath 'c:\Users<user>\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-25696-773225.json' -FeatureFlags @() '
The following extensions have contributed to this terminal's environment:
Git: Enables the following features: git auth provider`
The terminal output log for the extension only shows:
`9/4/2023 12:47:51 PM [NORMAL] - Visual Studio Code: v1.81.1 64-bit on Windows 64-bit
9/4/2023 12:47:51 PM [NORMAL] - PowerShell Extension: v2023.6.0
9/4/2023 12:47:52 PM [NORMAL] - Starting 'PowerShell_7' at: C:\Program Files\PowerShell\7\pwsh.exe
9/4/2023 12:47:54 PM [NORMAL] - PowerShell process started with PID: 16672`
Powershell editor outputlog:
`[Warn - 12:52:56 PM] OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.RequestCancelled | @request='OmniSharp.Extensions.JsonRpc.RequestCancelled'
I have settings synced to a different PC and it works fine there. I have uninstalled the extension, including in the .vscode folder
I see the pid is running, but it seems that the extension never 'gets told' about it, or that some other extension process is starting/hung.
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Visuals
Logs
When the terminal is closed the terminal output is shows:
9/4/2023 1:14:31 PM [VERBOSE] - Loaded settings:
{
"powerShellAdditionalExePaths": {
"PowerShell_7": "C:\Program Files\PowerShell\7\pwsh.exe",
"PowerShell": "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
},
"powerShellDefaultVersion": "PowerShell_7",
"powerShellExePath": "",
"promptToUpdatePowerShell": true,
"startAsLoginShell": {
"osx": true,
"linux": false
},
"startAutomatically": true,
"enableProfileLoading": true,
"helpCompletion": "BlockComment",
"scriptAnalysis": {
"enable": true,
"settingsPath": "PSScriptAnalyzerSettings.psd1"
},
"debugging": {
"createTemporaryIntegratedConsole": false
},
"developer": {
"featureFlags": [],
"bundledModulesPath": "../../PowerShellEditorServices/module",
"editorServicesLogLevel": "Diagnostic",
"editorServicesWaitForDebugger": false,
"waitForSessionFileTimeoutSeconds": 240
},
"codeFormatting": {
"autoCorrectAliases": true,
"avoidSemicolonsAsLineTerminators": false,
"preset": "Custom",
"openBraceOnSameLine": true,
"newLineAfterOpenBrace": true,
"newLineAfterCloseBrace": true,
"pipelineIndentationStyle": "NoIndentation",
"whitespaceBeforeOpenBrace": true,
"whitespaceBeforeOpenParen": true,
"whitespaceAroundOperator": true,
"whitespaceAfterSeparator": true,
"whitespaceBetweenParameters": false,
"whitespaceInsideBrace": true,
"addWhitespaceAroundPipe": true,
"trimWhitespaceAroundPipe": true,
"ignoreOneLineBlock": true,
"alignPropertyValuePairs": true,
"useConstantStrings": false,
"useCorrectCasing": false
},
"integratedConsole": {
"showOnStartup": true,
"startInBackground": false,
"focusConsoleOnExecute": true,
"useLegacyReadLine": false,
"forceClearScrollbackBuffer": false,
"suppressStartupBanner": false
},
"sideBar": {
"CommandExplorerVisibility": true,
"CommandExplorerExcludeFilter": []
},
"pester": {
"useLegacyCodeLens": true,
"outputVerbosity": "FromPreference",
"debugOutputVerbosity": "Diagnostic"
},
"buttons": {
"showRunButtons": true,
"showPanelMovementButtons": false
},
"cwd": "c:\Dev\VSC\Repos++Projects++\project\project",
"enableReferencesCodeLens": true,
"analyzeOpenDocumentsOnly": false
}
9/4/2023 1:14:31 PM [VERBOSE] - Creating log directory at: 'file:///c%3A/Users//AppData/Roaming/Code/User/globalStorage/ms-vscode.powershell/logs/1693826071-b016fe0c-aa75-41a2-8566-d3244cdae8c61693826024286'
9/4/2023 1:14:31 PM [NORMAL] - Visual Studio Code: v1.81.1 64-bit on Windows 64-bit
9/4/2023 1:14:31 PM [NORMAL] - PowerShell Extension: v2023.6.0
9/4/2023 1:14:31 PM [VERBOSE] - Session status changing from 'Not Started' to 'Starting'.
9/4/2023 1:14:31 PM [VERBOSE] - Finding PowerShell...
9/4/2023 1:14:31 PM [NORMAL] - Starting 'PowerShell_7' at: C:\Program Files\PowerShell\7\pwsh.exe
9/4/2023 1:14:31 PM [VERBOSE] - Starting process: C:\Program Files\PowerShell\7\pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users.vscode\extensions\ms-vscode.powershell-2023.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users.vscode\extensions\ms-vscode.powershell-2023.6.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.6.0
Copyright (c) Microsoft Corporation.
https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Diagnostic' -LogPath 'c:\Users\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1693826071-b016fe0c-aa75-41a2-8566-d3244cdae8c61693826024286\EditorServices.log' -SessionDetailsPath 'c:\Users\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-29264-104885.json' -FeatureFlags @()
9/4/2023 1:14:32 PM [NORMAL] - PowerShell process started with PID: 29800
9/4/2023 1:14:32 PM [VERBOSE] - Waiting for session file: file:///c%3A/Users//AppData/Roaming/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-29264-104885.json
9/4/2023 1:14:33 PM [VERBOSE] - Session file found.
9/4/2023 1:14:33 PM [VERBOSE] - Session details: {
"status": "started",
"languageServiceTransport": "NamedPipe",
"languageServicePipeName": "\.\pipe\PSES_mclz1pls.f3n",
"debugServiceTransport": "NamedPipe",
"debugServicePipeName": "\.\pipe\PSES_uy1w1z3b.a2z",
"powerShellVersion": "7.3.6"
}
9/4/2023 1:14:33 PM [VERBOSE] - Connecting to language service...
9/4/2023 1:14:33 PM [VERBOSE] - Language service connected.
9/4/2023 1:26:40 PM [WARNING] - PowerShell process terminated or Extension Terminal was closed, PID: 29800
9/4/2023 1:26:41 PM [ERROR] - Never finished startup!
The text was updated successfully, but these errors were encountered: