From 6067a88fb802ad36b27cc8fd9d0f1b9b945d0b06 Mon Sep 17 00:00:00 2001 From: Jacob Grossman Date: Thu, 2 Dec 2021 08:08:53 -0600 Subject: [PATCH] Add error notification, bump version number --- package.json | 5 ++--- src/commands.ts | 2 +- src/hubManager.ts | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5e3c59d..457e219 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,7 @@ "name": "mind-reader", "displayName": "Mind_Reader", "repository": "https://github.com/SingleSemesterSnobs/Mind_Reader", - "description": "", - "version": "0.0.1", + "version": "1.0.0", "engines": { "vscode": "^1.60.0" }, @@ -303,7 +302,7 @@ }, "mindReader.connection.portPath": { "type": "string", - "markdownDescription": "Specifies the serial port path to use if `#mindReader.connectAutomatically#` is not set." + "markdownDescription": "The default port to try and establish a connection on." }, "mindReader.connection.clearOutputOnRun": { "type": "boolean", diff --git a/src/commands.ts b/src/commands.ts index 4aa8b0c..2970d2a 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -388,7 +388,7 @@ let hub: HubManager | null = null; // TODO: port option async function connectHub(): Promise { - if (hub) { + if (hub && hub.isOpen()) { vscode.window.showWarningMessage('LEGO Hub is already connected, reconnecting...'); disconnectHub(); } diff --git a/src/hubManager.ts b/src/hubManager.ts index 0bf29a1..803616e 100644 --- a/src/hubManager.ts +++ b/src/hubManager.ts @@ -1,3 +1,4 @@ +import * as vscode from 'vscode'; import * as SerialPort from 'serialport'; import * as fs from 'fs'; @@ -97,6 +98,7 @@ export default class HubManager { logger.error(Buffer.from(params[3], 'base64').toString()); break; } + vscode.window.showErrorMessage("Program Error.") } } catch (err) { console.log('Could not parse JSON:', msg);