From 9a4cc1629050d6ccd07e9f3f02906876c11dc7ec Mon Sep 17 00:00:00 2001 From: meowjesty Date: Mon, 26 Feb 2024 17:53:48 -0300 Subject: [PATCH 1/3] Displays notification with trial days left. --- src/api.ts | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/api.ts b/src/api.ts index faba8faf..3b916a54 100644 --- a/src/api.ts +++ b/src/api.ts @@ -288,7 +288,7 @@ export class MirrordAPI { } } - /** + /** * Runs the extension execute sequence, creating agent and gathering execution runtime while also * setting env vars, both from system, and from `launch.json` (`configEnv`). * @@ -376,23 +376,40 @@ export class MirrordAPI { } } - if (message["type"] === "Warning") { - warningHandler.handle(message["message"]); - } else { - // If it is not last message, it is progress - let formattedMessage = message["name"]; - if (message["message"]) { - formattedMessage += ": " + message["message"]; + // TODO(alex) [high]: Move these "Warning | Info" to typed enum. + // Be very careful here, when showing messages, the notification is happy to take a json + // object, but it won't show anything! There is no json->string conversion, it just + // silently does nothing (no compiler warnings either). + switch (message["type"]) { + case "Warning": { + warningHandler.handle(message["message"]); + break; + } + case "Info": { + new NotificationBuilder() + .withMessage(message["message"]) + .info(); + break; + } + default: { + // If it is not last message, it is progress + let formattedMessage = message["name"]; + if (message["message"]) { + formattedMessage += ": " + message["message"]; + } + progress.report({ message: formattedMessage }); + break; } - progress.report({ message: formattedMessage }); } } + }); }); }); } } + class MirrordWarningHandler { private filters: [(message: string) => boolean, string][]; From a94792df9e2a8ecf7433a5005558643d442bff85 Mon Sep 17 00:00:00 2001 From: meowjesty Date: Tue, 27 Feb 2024 06:03:03 -0300 Subject: [PATCH 2/3] remove todo --- src/api.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/api.ts b/src/api.ts index 3b916a54..aaaca7e3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -376,7 +376,6 @@ export class MirrordAPI { } } - // TODO(alex) [high]: Move these "Warning | Info" to typed enum. // Be very careful here, when showing messages, the notification is happy to take a json // object, but it won't show anything! There is no json->string conversion, it just // silently does nothing (no compiler warnings either). @@ -402,14 +401,12 @@ export class MirrordAPI { } } } - }); }); }); } } - class MirrordWarningHandler { private filters: [(message: string) => boolean, string][]; From 48e05aa572ce447ee55a92354e5463ff67184c6a Mon Sep 17 00:00:00 2001 From: meowjesty Date: Fri, 1 Mar 2024 16:06:09 -0300 Subject: [PATCH 3/3] changelog --- changelog.d/382.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/382.added.md diff --git a/changelog.d/382.added.md b/changelog.d/382.added.md new file mode 100644 index 00000000..6e9d051e --- /dev/null +++ b/changelog.d/382.added.md @@ -0,0 +1 @@ +Notify user on license validity. \ No newline at end of file