MCPcopy
hub / github.com/PowerShell/vscode-powershell / startLanguageServerProcess

Method startLanguageServerProcess

src/session.ts:777–818  ·  view source on GitHub ↗
(
        powerShellExeDetails: IPowerShellExeDetails,
        cancellationToken: vscode.CancellationToken,
    )

Source from the content-addressed store, hash-verified

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).

Callers 1

startMethod · 0.95

Calls 7

getBundledModulesPathMethod · 0.95
getEditorServicesArgsMethod · 0.95
getNewSessionFilePathMethod · 0.95
setSessionStatusMethod · 0.95
promptForRestartMethod · 0.95
startMethod · 0.95
cleanUpTerminalsMethod · 0.80

Tested by

no test coverage detected