Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit b77146c

Browse files
preparing for deprecation
1 parent 6f24815 commit b77146c

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Visual Studio Code extension for Arduino
1+
# Visual Studio Code extension for Arduino (deprecated)
2+
3+
> **Warning**
4+
>
5+
> # This extension is deprecated and no longer maintained. We recommend existing customers to use the [Arduino IDE software](https://www.arduino.cc/en/software).
26
37
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-blue.svg)](https://gitter.im/Microsoft/vscode-arduino)
48

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vscode-arduino",
3-
"displayName": "Arduino",
4-
"description": "Arduino for Visual Studio Code",
5-
"version": "0.6.0",
3+
"displayName": "Arduino (deprecated)",
4+
"description": "Arduino for Visual Studio Code. This extension is deprecated and no longer maintained.",
5+
"version": "0.7.0",
66
"publisher": "vsciot-vscode",
77
"preview": true,
88
"engines": {

src/extension.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ import { SerialMonitor } from "./serialmonitor/serialMonitor";
2929
const usbDetectorModule = impor("./serialmonitor/usbDetector") as typeof import ("./serialmonitor/usbDetector");
3030

3131
export async function activate(context: vscode.ExtensionContext) {
32+
await vscode.window.showWarningMessage("The Arduino extension is deprecated. Please view our README for more information.", "View README").then((selection) => {
33+
if (selection === "View README") {
34+
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse("https://github.com/microsoft/vscode-arduino/blob/main/README.md"));
35+
}
36+
});
3237
Logger.configure(context);
3338
arduinoActivatorModule.default.context = context;
3439
const activeGuid = uuidModule().replace(/-/g, "");
@@ -75,24 +80,6 @@ export async function activate(context: vscode.ExtensionContext) {
7580
});
7681
};
7782

78-
async function askSwitchToBundledCli(message: string): Promise<void> {
79-
const result = await vscode.window.showErrorMessage(
80-
message, "Use bundled arduino-cli", "View settings");
81-
switch (result) {
82-
case "Use bundled arduino-cli": {
83-
Logger.traceUserData("switched-to-bundled-arduino-cli");
84-
await vscodeSettings.setUseArduinoCli(true);
85-
await vscodeSettings.setArduinoPath(undefined);
86-
await vscodeSettings.setCommandPath(undefined);
87-
await vscode.commands.executeCommand("workbench.action.reloadWindow");
88-
break;
89-
}
90-
case "View settings":
91-
await vscode.commands.executeCommand("workbench.action.openGlobalSettings");
92-
break;
93-
}
94-
}
95-
9683
if (!vscodeSettings.useArduinoCli) {
9784
// This notification is intentionally a little bit annoying (popping on
9885
// workspace open with no permanent dismissal) because we want to move
@@ -104,7 +91,6 @@ export async function activate(context: vscode.ExtensionContext) {
10491
// value of false. A future will make this breaking change with
10592
// appropriate messaging.
10693
Logger.traceUserData("using-legacy-arduino-ide");
107-
void askSwitchToBundledCli(constants.messages.REMOVE_ARDUINO_IDE_SUPPORT + " " + constants.messages.SWITCH_TO_BUNDLED_CLI);
10894
}
10995

11096
const registerArduinoCommand = (command: string, commandBody: (...args: any[]) => any, getUserData?: () => any): number => {
@@ -125,14 +111,12 @@ export async function activate(context: vscode.ExtensionContext) {
125111
// Ask the user to switch to the bundled Arduino CLI if we can't resolve the specified path.
126112
if (!usingBundledArduinoCli && (!arduinoPath || !validateArduinoPath(arduinoPath, useArduinoCli))) {
127113
Logger.traceError("InvalidArduinoPath", new Error(constants.messages.INVALID_ARDUINO_PATH));
128-
await askSwitchToBundledCli(constants.messages.INVALID_ARDUINO_PATH + " " + constants.messages.SWITCH_TO_BUNDLED_CLI);
129114
} else if (!commandPath || !util.fileExistsSync(commandPath)) {
130115
const error = new Error(constants.messages.INVALID_COMMAND_PATH + commandPath);
131116
if (usingBundledArduinoCli) {
132117
Logger.notifyUserError("InvalidCommandPath", error);
133118
} else {
134119
Logger.traceError("InvalidCommandPath", error);
135-
await askSwitchToBundledCli(error.message + " " + constants.messages.SWITCH_TO_BUNDLED_CLI);
136120
}
137121
} else {
138122
await commandExecution(command, commandBody, args, getUserData);

0 commit comments

Comments
 (0)