Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/extensions/common/extensionRunningLocation.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { ExtensionHostKind } from './extensionHostKind.js';
7
8
export class LocalProcessRunningLocation {
9
public readonly kind = ExtensionHostKind.LocalProcess;
10
constructor(
11
public readonly affinity: number
12
) { }
13
public equals(other: ExtensionRunningLocation) {
14
return (this.kind === other.kind && this.affinity === other.affinity);
15
}
16
public asString(): string {
17
if (this.affinity === 0) {
18
return 'LocalProcess';
19
}
20
return `LocalProcess${this.affinity}`;
21
}
22
}
23
24
export class LocalWebWorkerRunningLocation {
25
public readonly kind = ExtensionHostKind.LocalWebWorker;
26
constructor(
27
public readonly affinity: number
28
) { }
29
public equals(other: ExtensionRunningLocation) {
30
return (this.kind === other.kind && this.affinity === other.affinity);
31
}
32
public asString(): string {
33
if (this.affinity === 0) {
34
return 'LocalWebWorker';
35
}
36
return `LocalWebWorker${this.affinity}`;
37
}
38
}
39
40
export class RemoteRunningLocation {
41
public readonly kind = ExtensionHostKind.Remote;
42
public readonly affinity = 0;
43
public equals(other: ExtensionRunningLocation) {
44
return (this.kind === other.kind);
45
}
46
public asString(): string {
47
return 'Remote';
48
}
49
}
50
51
export type ExtensionRunningLocation = LocalProcessRunningLocation | LocalWebWorkerRunningLocation | RemoteRunningLocation;
52
53