diff --git a/package-lock.json b/package-lock.json index b0702e597..7b8613ef0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26317,7 +26317,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -26477,6 +26478,7 @@ "version": "2.9.0", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -26495,6 +26497,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -26597,6 +26600,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -26682,7 +26686,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -26718,6 +26723,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -26781,12 +26787,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true } } } diff --git a/package.json b/package.json index 59e9b4417..4c18fe24a 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "category": "%deviceSimulatorExpressExtension.commands.common.label%" }, { - "command": "deviceSimulatorExpress.common.openSerialMonitor", "title": "%deviceSimulatorExpressExtension.commands.common.openSerialMonitor%", "category": "%deviceSimulatorExpressExtension.commands.common.label%" diff --git a/src/constants.ts b/src/constants.ts index a906ecfb7..5d30b3602 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -69,6 +69,7 @@ export const CONSTANTS = { "error.installationError", "Installation Error" ), + INVALID_FILE_EXTENSION_DEBUG: localize( "error.invalidFileExtensionDebug", "The file you tried to run isn't a Python file." diff --git a/src/extension.ts b/src/extension.ts index 4fa015247..59d9d87e8 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -921,6 +921,22 @@ export async function activate(context: vscode.ExtensionContext) { } ); + const showReleaseNote = vscode.commands.registerCommand( + "deviceSimulatorExpress.", + (port, showWarning = true) => { + if (serialMonitor) { + telemetryAI.runWithLatencyMeasure(() => { + serialMonitor.closeSerialMonitor(port, showWarning); + }, TelemetryEventName.COMMAND_SERIAL_MONITOR_CLOSE); + } else { + vscode.window.showErrorMessage( + CONSTANTS.ERROR.NO_FOLDER_OPENED + ); + console.info("Serial monitor is not defined."); + } + } + ); + UsbDetector.getInstance().initialize(context.extensionPath); UsbDetector.getInstance().startListening();