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

Method sessionStarted

src/session.ts:865–897  ·  view source on GitHub ↗
(
        sessionDetails: IEditorServicesSessionDetails,
    )

Source from the content-addressed store, hash-verified

863 }
864
865 private sessionStarted(
866 sessionDetails: IEditorServicesSessionDetails,
867 ): boolean {
868 this.logger.writeDebug(
869 `Session details: ${JSON.stringify(sessionDetails, undefined, 2)}`,
870 );
871 if (sessionDetails.status === "started") {
872 // Successful server start with a session file
873 return true;
874 }
875 if (sessionDetails.status === "failed") {
876 // Server started but indicated it failed
877 if (sessionDetails.reason === "powerShellVersion") {
878 void this.setSessionFailedGetPowerShell(
879 `PowerShell ${sessionDetails.powerShellVersion} is not supported, please update!`,
880 );
881 } else if (sessionDetails.reason === "dotNetVersion") {
882 // Only applies to PowerShell 5.1
883 void this.setSessionFailedGetDotNet(
884 ".NET Framework is out-of-date, please install at least 4.8!",
885 );
886 } else {
887 void this.setSessionFailedOpenBug(
888 `PowerShell could not be started for an unknown reason: ${sessionDetails.reason}`,
889 );
890 }
891 } else {
892 void this.setSessionFailedOpenBug(
893 `PowerShell could not be started with an unknown status: ${sessionDetails.status}, and reason: ${sessionDetails.reason}`,
894 );
895 }
896 return false;
897 }
898
899 private async startLanguageClient(
900 sessionDetails: IEditorServicesSessionDetails,

Callers 1

startMethod · 0.95

Calls 4

writeDebugMethod · 0.65

Tested by

no test coverage detected