Path: blob/main/src/vs/workbench/services/extensions/common/extensionRunningLocation.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { ExtensionHostKind } from './extensionHostKind.js';67export class LocalProcessRunningLocation {8public readonly kind = ExtensionHostKind.LocalProcess;9constructor(10public readonly affinity: number11) { }12public equals(other: ExtensionRunningLocation) {13return (this.kind === other.kind && this.affinity === other.affinity);14}15public asString(): string {16if (this.affinity === 0) {17return 'LocalProcess';18}19return `LocalProcess${this.affinity}`;20}21}2223export class LocalWebWorkerRunningLocation {24public readonly kind = ExtensionHostKind.LocalWebWorker;25constructor(26public readonly affinity: number27) { }28public equals(other: ExtensionRunningLocation) {29return (this.kind === other.kind && this.affinity === other.affinity);30}31public asString(): string {32if (this.affinity === 0) {33return 'LocalWebWorker';34}35return `LocalWebWorker${this.affinity}`;36}37}3839export class RemoteRunningLocation {40public readonly kind = ExtensionHostKind.Remote;41public readonly affinity = 0;42public equals(other: ExtensionRunningLocation) {43return (this.kind === other.kind);44}45public asString(): string {46return 'Remote';47}48}4950export type ExtensionRunningLocation = LocalProcessRunningLocation | LocalWebWorkerRunningLocation | RemoteRunningLocation;515253