(
powerShellExeDetails: IPowerShellExeDetails,
cancellationToken: vscode.CancellationToken,
)
| 775 | } |
| 776 | |
| 777 | private async startLanguageServerProcess( |
| 778 | powerShellExeDetails: IPowerShellExeDetails, |
| 779 | cancellationToken: vscode.CancellationToken, |
| 780 | ): Promise<PowerShellProcess> { |
| 781 | const bundledModulesPath = await this.getBundledModulesPath(); |
| 782 | |
| 783 | // Dispose any stale terminals from previous killed sessions. |
| 784 | PowerShellProcess.cleanUpTerminals(); |
| 785 | const languageServerProcess = new PowerShellProcess( |
| 786 | powerShellExeDetails.exePath, |
| 787 | bundledModulesPath, |
| 788 | false, |
| 789 | this.shellIntegrationEnabled, |
| 790 | this.logger, |
| 791 | this.extensionContext.logUri, |
| 792 | this.getEditorServicesArgs( |
| 793 | bundledModulesPath, |
| 794 | powerShellExeDetails, |
| 795 | ), |
| 796 | this.getNewSessionFilePath(), |
| 797 | this.sessionSettings, |
| 798 | this.extensionContext.extensionMode == |
| 799 | vscode.ExtensionMode.Development, |
| 800 | ); |
| 801 | |
| 802 | languageServerProcess.onExited(() => { |
| 803 | LanguageClientConsumer.onLanguageClientExited(); |
| 804 | |
| 805 | if ( |
| 806 | this.sessionStatus === SessionStatus.Running || |
| 807 | this.sessionStatus === SessionStatus.Busy |
| 808 | ) { |
| 809 | this.setSessionStatus("Session Exited!", SessionStatus.Failed); |
| 810 | void this.promptForRestart(); |
| 811 | } |
| 812 | }); |
| 813 | |
| 814 | this.sessionDetails = |
| 815 | await languageServerProcess.start(cancellationToken); |
| 816 | |
| 817 | return languageServerProcess; |
| 818 | } |
| 819 | |
| 820 | // The process failed to start, so check for common user errors (generally |
| 821 | // out-of-support versions of PowerShell). |
no test coverage detected