From 4aa895b19056da6f24b9c705333e9afd63b25d8c Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Tue, 12 Mar 2024 13:47:29 +0100 Subject: [PATCH] fix: fallback to device name when platform cant be derrived --- src/expoDebuggers.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/expoDebuggers.ts b/src/expoDebuggers.ts index cce5071..ad031f4 100644 --- a/src/expoDebuggers.ts +++ b/src/expoDebuggers.ts @@ -192,9 +192,13 @@ export class ExpoDebuggersProvider implements vscode.DebugConfigurationProvider } // Resolve the target device config to inspect - const { platform, ...deviceConfig } = await resolveDeviceConfig(config, project); + const { platform, deviceName, ...deviceConfig } = await resolveDeviceConfig(config, project); - featureTelemetry('debugger', `${DEBUG_TYPE}`, { platform, expoVersion: project.expoVersion }); + featureTelemetry('debugger', `${DEBUG_TYPE}`, { + platform, + deviceName, + expoVersion: project.expoVersion, + }); return { ...config, ...deviceConfig }; } @@ -207,8 +211,11 @@ async function resolveDeviceConfig(config: ExpoDebugConfig, project: ExpoProject throw new Error('Expo debug session aborted.'); } + const platform = inferDevicePlatform(device); + return { - platform: inferDevicePlatform(device) ?? 'unknown', + platform: platform ?? 'unknown', + deviceName: platform ? undefined : device.deviceName ?? 'unknown', // The address of the device to connect to websocketAddress: