src/vs/workbench/services/extensions/electron-browser/extensionService.ts/ExtensionService/pickRunningLocation
class ExtensionService:	public static pickRunningLocation(extensionKinds: ExtensionKind[], isInstalledLocally: boolean, isInstalledRemotely: boolean, preference: ExtensionRunningPreference, hasRemoteExtHost: boolean, hasWebWorkerExtHost: boolean): ExtensionRunningLocation {
		const result: ExtensionRunningLocation[] = [];
		for (const extensionKind of extensionKinds) {
			if (extensionKind === 'ui' && isInstalledLocally) {
				// ui extensions run locally if possible
				if (preference === ExtensionRunningPreference.None || preference === ExtensionRunningPreference.Local) {
					return ExtensionRunningLocation.LocalProcess;
				} else {
					result.push(ExtensionRunningLocation.LocalProcess);
				}
			}
			if (extensionKind === 'workspace' && isInstalledRemotely) {
				// workspace extensions run remotely if possible
				if (preference === ExtensionRunningPreference.None || preference === ExtensionRunningPreference.Remote) {
					return ExtensionRunningLocation.Remote;
				} else {
					result.push(ExtensionRunningLocation.Remote);
				}
			}
			if (extensionKind === 'workspace' && !hasRemoteExtHost) {
				// workspace extensions also run locally if there is no remote
				if (preference === ExtensionRunningPreference.None || preference === ExtensionRunningPreference.Local) {
					return ExtensionRunningLocation.LocalProcess;
				} else {
					result.push(ExtensionRunningLocation.LocalProcess);
				}
			}
			if (extensionKind === 'web' && isInstalledLocally && hasWebWorkerExtHost) {
				// web worker extensions run in the local web worker if possible
				if (preference === ExtensionRunningPreference.None || preference === ExtensionRunningPreference.Local) {
					return ExtensionRunningLocation.LocalWebWorker;
				} else {
					result.push(ExtensionRunningLocation.LocalWebWorker);
				}
			}
		}
		return (result.length > 0 ? result[0] : ExtensionRunningLocation.None);
	}