MCPcopy Index your code
hub / github.com/PowerShell/vscode-powershell / constructor

Method constructor

src/session.ts:129–172  ·  view source on GitHub ↗
(
        private extensionContext: vscode.ExtensionContext,
        private sessionSettings: Settings,
        private logger: ILogger,
        private documentSelector: DocumentSelector,
        hostName: string,
        displayName: string,
        hostVersion: string,
        publisher: string,
        private telemetryReporter: TelemetryReporter,
    )

Source from the content-addressed store, hash-verified

127 private traceLogLevelHandler?: vscode.Disposable;
128
129 constructor(
130 private extensionContext: vscode.ExtensionContext,
131 private sessionSettings: Settings,
132 private logger: ILogger,
133 private documentSelector: DocumentSelector,
134 hostName: string,
135 displayName: string,
136 hostVersion: string,
137 publisher: string,
138 private telemetryReporter: TelemetryReporter,
139 ) {
140 // Create the language status item
141 this.languageStatusItem = this.createStatusBarItem();
142 // We have to override the scheme because it defaults to
143 // 'vscode-userdata' which breaks UNC paths.
144 this.sessionsFolder = vscode.Uri.joinPath(
145 extensionContext.globalStorageUri.with({ scheme: "file" }),
146 "sessions",
147 );
148
149 this.platformDetails = getPlatformDetails();
150 this.HostName = hostName;
151 this.DisplayName = displayName;
152 this.HostVersion = hostVersion;
153 this.Publisher = publisher;
154
155 const osBitness = this.platformDetails.isOS64Bit ? "64-bit" : "32-bit";
156 const procBitness = this.platformDetails.isProcess64Bit
157 ? "64-bit"
158 : "32-bit";
159
160 this.logger.write(
161 `Visual Studio Code: v${vscode.version} ${procBitness}` +
162 ` on ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}`,
163 `${this.DisplayName} Extension: v${this.HostVersion}`,
164 );
165
166 // Fix the host version so that PowerShell can consume it.
167 // This is needed when the extension uses a prerelease
168 // version string like 0.9.1-insiders-1234.
169 this.HostVersion = this.HostVersion.split("-")[0];
170
171 this.registerCommands();
172 }
173
174 public async dispose(): Promise<void> {
175 await this.stop(); // A whole lot of disposals.

Callers

nothing calls this directly

Calls 4

createStatusBarItemMethod · 0.95
registerCommandsMethod · 0.95
getPlatformDetailsFunction · 0.90
writeMethod · 0.65

Tested by

no test coverage detected