diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 47a37649..7ab473b9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -53,7 +53,6 @@ jobs:
- name: scripts
run: |
gulp tslint
- gulp genAikey
vsce package
- name: run tests
if: ${{ matrix.os != 'windows-latest' }}
@@ -93,7 +92,6 @@ jobs:
- name: scripts
run: |
gulp tslint
- gulp genAikey
vsce package
- name: upload .vsix to github tag
uses: svenstaro/upload-release-action@v2
@@ -111,4 +109,8 @@ jobs:
fi
- name: publish
if: steps.check-version.outputs.ISPRODUCTION == 'true'
- run: vsce publish -p ${{ secrets.VSCE_TOKEN }}
+ env:
+ PROD_AIKEY: ${{ secrets.PROD_AIKEY }}
+ run: |
+ gulp genAikey
+ vsce publish -p ${{ secrets.VSCE_TOKEN }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a0529ebd..913605a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,14 +1,26 @@
# Change Log
All notable changes to this project will be documented in this file.
+## Version 0.4.1
+
+### Added
+- Quickpick sketch selection [#1128](https://github.com/microsoft/vscode-arduino/pull/1128) Thanks [@maddogjt](https://github.com/maddogjt)
+
+### Fixed
+- Arduino CLI on MacOS [#1221](https://github.com/microsoft/vscode-arduino/issues/1221) Thanks [@awmichel](https://github.com/awmichel)
+- Typos [#1226](https://github.com/microsoft/vscode-arduino/pull/1226), [#1225](https://github.com/microsoft/vscode-arduino/pull/1225), [#1191](https://github.com/microsoft/vscode-arduino/pull/1191) Thanks [@jogo-](https://github.com/jogo-) [@CBielstein](https://github.com/CBielstein)
+- add USBCON back into IntelliSense config [#1216](https://github.com/microsoft/vscode-arduino/issues/1216)
+- Update depedencies
+- App Insights key in Actions [#1236](https://github.com/microsoft/vscode-arduino/pull/1236)
+
## Version 0.4.0
### Added
-- Support for Arduino CLI (#1017)
+- Support for Arduino CLI #1017
### Changed
-- Autogenerate c_cpp_properties.json with all complier arguments and libraries for IntelliSense (#1183)
-- Detects available programmers for selected board (#1118)
+- Autogenerate c_cpp_properties.json with all complier arguments and libraries for IntelliSense #1183
+- Detects available programmers for selected board #1118
### Fixed
- Typos
@@ -17,7 +29,7 @@ All notable changes to this project will be documented in this file.
- Unifies all build commands under a single
### Known Issues
-- Arduino CLI doesn't work on Mac (#1205)
+- Arduino CLI doesn't work on Mac [#1205](https://github.com/microsoft/vscode-arduino/issues/1205)
## Version 0.3.5
@@ -31,8 +43,8 @@ All notable changes to this project will be documented in this file.
- Release date: November 22, 2020
### Changed
-- Add DTR and RTS signals on serial open and buad rate change
-- Improves c_cpp_properties.json autogeneration for intelliSense
+- Add DTR and RTS signals on serial open and baud rate change
+- Improves c_cpp_properties.json autogeneration for IntelliSense
## Version 0.3.3
@@ -69,7 +81,7 @@ All notable changes to this project will be documented in this file.
- Fix issue of "Fail to debug on Ubuntu". [[#933](https://github.com/microsoft/vscode-arduino/issues/933)]
- Remove line ending selection. Fix the issue of "Save the last used end of line". [[#952](https://github.com/microsoft/vscode-arduino/issues/952)]
- Fix the issue of "Can't install libraries from VS Code for ESP8266". [[#930](https://github.com/microsoft/vscode-arduino/issues/930)]
-- Fix the issue of "Project path can not be changed". [[#978](https://github.com/microsoft/vscode-arduino/issues/978)]
+- Fix the issue of "Project path cannot be changed". [[#978](https://github.com/microsoft/vscode-arduino/issues/978)]
Special thanks to [raomin](https://github.com/raomin), thanks for your contributions and feedbacks.
@@ -82,7 +94,7 @@ Special thanks to [raomin](https://github.com/raomin), thanks for your contribut
## Version 0.2.28
-- Release data: November 15, 2019
+- Release date: November 15, 2019
### Fixed
@@ -158,7 +170,7 @@ Special thanks to [Deqing Sun](https://github.com/DeqingSun), thank you for your
- Add sketches folder into examples view [#652](https://github.com/Microsoft/vscode-arduino/issues/652)
### Changed
-- Change Arduino langauge ID to C++ [#686](https://github.com/Microsoft/vscode-arduino/issues/686)
+- Change Arduino language ID to C++ [#686](https://github.com/Microsoft/vscode-arduino/issues/686)
- Use VS Code new webview API [#701](https://github.com/Microsoft/vscode-arduino/issues/701)
### Fixed
@@ -181,7 +193,7 @@ Special thanks to [Deqing Sun](https://github.com/DeqingSun), [Takashi Matsuoka]
- Fix the output path not exist issue [#641](https://github.com/Microsoft/vscode-arduino/issues/641)
- Update arduino.path instruction [#635](https://github.com/Microsoft/vscode-arduino/issues/635)
-Special thanks to [aster94](https://github.com/aster94), [Niels van der Veer](https://github.com/n9iels), [AntoineGirafe](https://github.com/AntoineGirafe), thank you foryour contributions and feedbacks.
+Special thanks to [aster94](https://github.com/aster94), [Niels van der Veer](https://github.com/n9iels), [AntoineGirafe](https://github.com/AntoineGirafe), thank you for your contributions and feedbacks.
## Version 0.2.20
@@ -206,7 +218,7 @@ Special thanks to [aster94](https://github.com/aster94), [Niels van der Veer](ht
- Add Wio 3G board and WeMos D1 board [#223](https://github.com/Microsoft/vscode-arduino/pull/223)
### Fixed
-- Fix intellisense issue of `c_cpp_properties.json`
+- Fix IntelliSense issue of `c_cpp_properties.json`
- Fix "Verifying" is misspelled issue [#591](https://github.com/Microsoft/vscode-arduino/issues/591)
- Improve config setting descriptions [#605](https://github.com/Microsoft/vscode-arduino/issues/605)
@@ -241,13 +253,13 @@ Special thanks to [Thad House](https://github.com/ThadHouse), [Carlos Gomez](htt
### Added
- Add a sketch file button in status bar to reset sketch file [#481](https://github.com/Microsoft/vscode-arduino/issues/481)
- Add loading status bar for verify and build command [#137](https://github.com/Microsoft/vscode-arduino/issues/137)
-- Add `prebuild` support in `arduio.json` [#411](https://github.com/Microsoft/vscode-arduino/issues/411)
+- Add `prebuild` support in `arduino.json` [#411](https://github.com/Microsoft/vscode-arduino/issues/411)
- Add upload using programmer command [#407](https://github.com/Microsoft/vscode-arduino/issues/407)
- Add ignore option for board detection notification [#495](https://github.com/Microsoft/vscode-arduino/issues/495)
- Add settings for disable/enable serial monitor TestingOpen [#530](https://github.com/Microsoft/vscode-arduino/issues/530)
### Fixed
-- Fix intellisense issue of `c_cpp_properties.json` (preview) [#438](https://github.com/Microsoft/vscode-arduino/issues/438)
+- Fix IntelliSense issue of `c_cpp_properties.json` (preview) [#438](https://github.com/Microsoft/vscode-arduino/issues/438)
Special thanks to [Joel Santos](https://github.com/mundodisco8), [John](https://github.com/VashJuan), [mybayern1974](https://github.com/mybayern1974), [Maxime Paquatte](https://github.com/maxime-paquatte), [Joe Saavedra](https://github.com/jmsaavedra), [Kye Burchard](https://github.com/kyeb), [Laurent Haas - F6FVY](https://github.com/f6fvy), thank you for your feedbacks.
@@ -337,7 +349,7 @@ Special thanks to [GarethE](https://github.com/keyoke), thank you for your contr
- Contribution from [DeqingSun](https://github.com/DeqingSun): Add board support for STM32F1 with Arudino_STM32 [#377](https://github.com/Microsoft/vscode-arduino/pull/377)
### Changed
-- Leverage the ouput path config to speedup upload/verify
+- Leverage the output path config to speedup upload/verify
- Fix USB detection issue during uploading [#371](https://github.com/Microsoft/vscode-arduino/pull/371), [372](https://github.com/Microsoft/vscode-arduino/pull/372)
- Contribution from [lialosiu](https://github.com/lialosiu): Fix encoding issue for non UTF-8 [#364](https://github.com/Microsoft/vscode-arduino/pull/364)
- Update the documents with the helps of
@@ -361,7 +373,7 @@ Special thanks to [GarethE](https://github.com/keyoke), thank you for your contr
### Changed
- Use a new configuration page for switching arduino boards
-- Lazy load the arduino extension on start up, only usb detection works in background, when it detects an arduino board, the extension will fully activate
+- Lazy load the arduino extension on startup, only usb detection works in background, when it detects an arduino board, the extension will fully activate
- Update unit test to some basic arduino commands
- Fix some typos in code
- Fix issue #289 #324 #327
@@ -432,4 +444,4 @@ Special thanks to [GarethE](https://github.com/keyoke), thank you for your contr
- Built-in serial monitor
- Snippets for sketches
- Automatic Arduino project scaffolding
-- Commond Palette (F1) integration of frequently used commands (e.g. Verify, Upload...)
+- Command Palette (F1) integration of frequently used commands (e.g. Verify, Upload...)
diff --git a/README.md b/README.md
index 3bc3adff..3935ca40 100644
--- a/README.md
+++ b/README.md
@@ -22,12 +22,12 @@ Either the Arduino IDE or Arduino CLI are required.
The Arduino IDE can be installed the Arduino [download page](https://www.arduino.cc/en/main/software#download).
- The supported Arduino IDE versions are `1.6.x` and later.
- The Windows Store's version of the Arduino IDE is not supported because of the sandbox environment that the application runs in.
-- *Note:* Arduino IDE `1.8.7` has some breaking changes, causing board package and library installation failures.
+- *Note:* Arduino IDE `1.8.7` had some breaking changes, causing board package and library installation failures. These failures were corrected in `1.8.8` and later.
### Arduino CLI
The Arduino CLI can be downloaded from the repository's [release page](https://github.com/arduino/arduino-cli/releases/tag/0.13.0)
- The extension has only been tested with v0.13.0.
-- If you use the CLI you will have to set `arduino.path` since the CLI does not have a defualt path.
+- If you use the CLI you will have to set `arduino.path` since the CLI does not have a default path.
## Installation
Open VS Code and press F1 or Ctrl + Shift + P to open command palette, select **Install Extension** and type `vscode-arduino`.
@@ -60,7 +60,7 @@ This extension provides several commands in the Command Palette (F1 o
- **Arduino: Upload Using Programmer**: Upload using an external programmer.
- **Arduino: CLI Upload Using Programmer**: Upload using an external programmer without building sketch (CLI only).
- **Arduino: Verify**: Build sketch.
-- **Arduino: Rebuild IntelliSense Configuration**: Forced/manual rebuild of the IntelliSense configuration. The extension analyzes Arduino's build output and sets the Intellisense include paths, defines, compiler arguments accordingly.
+- **Arduino: Rebuild IntelliSense Configuration**: Forced/manual rebuild of the IntelliSense configuration. The extension analyzes Arduino's build output and sets the IntelliSense include paths, defines, compiler arguments accordingly.
## Keybindings
- **Arduino: Upload** Alt + Cmd + U *or* Alt + Ctrl + U
@@ -71,10 +71,10 @@ This extension provides several commands in the Command Palette (F1 o
| Option | Description |
| --- | --- |
| `arduino.path` | Path to Arduino, you can use a custom version of Arduino by modifying this setting to include the full path. Example: `C:\\Program Files\\Arduino` for Windows, `/Applications` for Mac, `/home//Downloads/arduino-1.8.1` for Linux. (Requires a restart after change). The default value is automatically detected from your Arduino IDE installation path. |
-| `arduino.commandPath` | Path to an executable (or script) relative to `arduino.path`. The default value is `arduino_debug.exe` for windows,`Contents/MacOS/Arduino` for Mac and `arduino` for Linux, You also can use a custom launch script to run Arduino by modifying this setting. (Requires a restart after change) Example: `run-arduino.bat` for Windows, `Contents/MacOS/run-arduino.sh` for Mac and `bin/run-arduino.sh` for Linux. |
+| `arduino.commandPath` | Path to an executable (or script) relative to `arduino.path`. The default value is `arduino_debug.exe` for Windows, `Contents/MacOS/Arduino` for Mac and `arduino` for Linux, You also can use a custom launch script to run Arduino by modifying this setting. (Requires a restart after change) Example: `run-arduino.bat` for Windows, `Contents/MacOS/run-arduino.sh` for Mac and `bin/run-arduino.sh` for Linux. |
| `arduino.additionalUrls` | Additional Boards Manager URLs for 3rd party packages. You can have multiple URLs in one string with a comma(`,`) as separator, or have a string array. The default value is empty. |
| `arduino.logLevel` | CLI output log level. Could be info or verbose. The default value is `"info"`. |
-| `arduino.allowPDEFiletype` | Allow the VSCode Arduino extension to open .pde files from pre-1.0.0 versions of Ardiuno. Note that this will break Processing code. Default value is `false`. |
+| `arduino.allowPDEFiletype` | Allow the VSCode Arduino extension to open .pde files from pre-1.0.0 versions of Arduino. Note that this will break Processing code. Default value is `false`. |
| `arduino.enableUSBDetection` | Enable/disable USB detection from the VSCode Arduino extension. The default value is `true`. When your device is plugged in to your computer, it will pop up a message "`Detected board ****, Would you like to switch to this board type`". After clicking the `Yes` button, it will automatically detect which serial port (COM) is connected a USB device. If your device does not support this feature, please provide us with the PID/VID of your device; the code format is defined in `misc/usbmapping.json`.To learn more about how to list the vid/pid, use the following tools: https://github.com/EmergingTechnologyAdvisors/node-serialport `npm install -g serialport` `serialport-list -f jsonline`|
| `arduino.disableTestingOpen` | Enable/disable automatic sending of a test message to the serial port for checking the open status. The default value is `false` (a test message will be sent). |
| `arduino.skipHeaderProvider` | Enable/disable the extension providing completion items for headers. This functionality is included in newer versions of the C++ extension. The default value is `false`.|
diff --git a/gulpfile.js b/gulpfile.js
index 7888a888..a8955511 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -81,20 +81,10 @@ gulp.task("clean", (done) => {
});
gulp.task("genAikey", (done) => {
- if (process.env.TRAVIS_TAG) {
- const ISPROD = /^v?[0-9]+\.[0-9]+\.[0-9]+$/.test(process.env.TRAVIS_TAG || "");
- const packageJson = JSON.parse(fs.readFileSync("package.json"));
- if (ISPROD) {
- packageJson.aiKey = process.env["PROD_AIKEY"];
- } else {
- packageJson.aiKey = process.env["INT_AIKEY"] || packageJson.aiKey;
- }
- fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
- done();
- } else {
- log("Skipping genAiKey");
- done();
- }
+ const packageJson = JSON.parse(fs.readFileSync("package.json"));
+ packageJson.aiKey = process.env.PROD_AIKEY;
+ fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
+ done();
});
gulp.task("test", (done) => {
diff --git a/package-lock.json b/package-lock.json
index 50043aaa..4354db20 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "vscode-arduino",
- "version": "0.4.0",
+ "version": "0.4.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -1332,9 +1332,9 @@
}
},
"y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
+ "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"dev": true
},
"yallist": {
@@ -2210,24 +2210,30 @@
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"elliptic": {
- "version": "6.5.3",
- "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
- "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
+ "version": "6.5.4",
+ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
+ "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
"dev": true,
"requires": {
- "bn.js": "^4.4.0",
- "brorand": "^1.0.1",
+ "bn.js": "^4.11.9",
+ "brorand": "^1.1.0",
"hash.js": "^1.0.0",
- "hmac-drbg": "^1.0.0",
- "inherits": "^2.0.1",
- "minimalistic-assert": "^1.0.0",
- "minimalistic-crypto-utils": "^1.0.0"
+ "hmac-drbg": "^1.0.1",
+ "inherits": "^2.0.4",
+ "minimalistic-assert": "^1.0.1",
+ "minimalistic-crypto-utils": "^1.0.1"
},
"dependencies": {
"bn.js": {
- "version": "4.11.9",
- "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
- "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+ "version": "4.12.0",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+ "dev": true
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
}
}
@@ -6223,9 +6229,9 @@
}
},
"y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
+ "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"dev": true
},
"yargs": {
@@ -9315,9 +9321,9 @@
"dev": true
},
"y18n": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
- "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
+ "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==",
"dev": true
},
"yargs": {
@@ -9574,9 +9580,9 @@
}
},
"y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
+ "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"dev": true
},
"yargs": {
diff --git a/package.json b/package.json
index a97d952f..d049cf7a 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "vscode-arduino",
"displayName": "Arduino",
"description": "Arduino for Visual Studio Code",
- "version": "0.4.0",
+ "version": "0.4.1",
"publisher": "vsciot-vscode",
"aiKey": "83dd2c27-6594-41d3-85a9-bdb22070eb42",
"preview": true,
@@ -42,6 +42,7 @@
"onCommand:arduino.rebuildIntelliSenseConfig",
"onCommand:arduino.selectProgrammer",
"onCommand:arduino.selectSerialPort",
+ "onCommand:arduino.selectSketch",
"onCommand:arduino.changeBaudRate",
"onCommand:arduino.openSerialMonitor",
"onCommand:arduino.sendMessageToSerialPort",
@@ -115,6 +116,10 @@
"command": "arduino.selectProgrammer",
"title": "Arduino: Select Programmer"
},
+ {
+ "command": "arduino.selectSketch",
+ "title": "Arduino: Select Sketch"
+ },
{
"command": "arduino.selectSerialPort",
"title": "Arduino: Select Serial Port"
diff --git a/src/arduino/arduinoSettings.ts b/src/arduino/arduinoSettings.ts
index 8d994d81..0e4a01cb 100644
--- a/src/arduino/arduinoSettings.ts
+++ b/src/arduino/arduinoSettings.ts
@@ -104,7 +104,7 @@ export class ArduinoSettings implements IArduinoSettings {
public get defaultExamplePath(): string {
if (os.platform() === "darwin") {
- return path.join(util.resolveMacArduinoAppPath(this._arduinoPath), "/Contents/Java/examples");
+ return path.join(util.resolveMacArduinoAppPath(this._arduinoPath, this._useArduinoCli), "/Contents/Java/examples");
} else {
return path.join(this._arduinoPath, "examples");
}
@@ -116,7 +116,7 @@ export class ArduinoSettings implements IArduinoSettings {
public get defaultPackagePath(): string {
if (os.platform() === "darwin") {
- return path.join(util.resolveMacArduinoAppPath(this._arduinoPath), "/Contents/Java/hardware");
+ return path.join(util.resolveMacArduinoAppPath(this._arduinoPath, this._useArduinoCli), "/Contents/Java/hardware");
} else { // linux and win32.
return path.join(this._arduinoPath, "hardware");
}
@@ -124,7 +124,7 @@ export class ArduinoSettings implements IArduinoSettings {
public get defaultLibPath(): string {
if (os.platform() === "darwin") {
- return path.join(util.resolveMacArduinoAppPath(this._arduinoPath), "/Contents/Java/libraries");
+ return path.join(util.resolveMacArduinoAppPath(this._arduinoPath, this._useArduinoCli), "/Contents/Java/libraries");
} else { // linux and win32
return path.join(this._arduinoPath, "libraries");
}
@@ -133,7 +133,7 @@ export class ArduinoSettings implements IArduinoSettings {
public get commandPath(): string {
const platform = os.platform();
if (platform === "darwin") {
- return path.join(util.resolveMacArduinoAppPath(this._arduinoPath), path.normalize(this._commandPath));
+ return path.join(util.resolveMacArduinoAppPath(this._arduinoPath, this._useArduinoCli), path.normalize(this._commandPath));
} else {
return path.join(this._arduinoPath, path.normalize(this._commandPath));
}
diff --git a/src/arduino/intellisense.ts b/src/arduino/intellisense.ts
index 56daeea7..1458cedd 100644
--- a/src/arduino/intellisense.ts
+++ b/src/arduino/intellisense.ts
@@ -101,6 +101,9 @@ export function makeCompilerParserContext(dc: DeviceContext): ICoCoPaContext {
runner.result.options.splice(mmdIndex);
}
+ // Add USB Connected marco to defines
+ runner.result.defines.push("USBCON")
+
try {
const cmd = os.platform() === "darwin" ? "Cmd" : "Ctrl";
diff --git a/src/common/sys/darwin.ts b/src/common/sys/darwin.ts
index 4d5c7e98..f17cfd94 100644
--- a/src/common/sys/darwin.ts
+++ b/src/common/sys/darwin.ts
@@ -1,40 +1,39 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT license.
-
-import * as childProcess from "child_process";
-import * as path from "path";
-import { directoryExistsSync, fileExistsSync, resolveMacArduinoAppPath } from "../util";
-
-export function resolveArduinoPath(): string {
- let result;
-
- const defaultCommonPaths = [path.join(process.env.HOME, "Applications"), "/Applications"];
- for (const scanPath of defaultCommonPaths) {
- if (directoryExistsSync(path.join(scanPath, "Arduino.app"))) {
- result = scanPath;
- break;
- }
- }
- return result || "";
-}
-
-export function validateArduinoPath(arduinoPath: string, useArduinoCli = false): boolean {
- return fileExistsSync(path.join(resolveMacArduinoAppPath(arduinoPath), useArduinoCli ? "arduino-cli" : "/Contents/MacOS/Arduino"));
-
-}
-
-export function findFile(fileName: string, cwd: string): string {
- let pathString;
- try {
- pathString = childProcess.execSync(`find ${cwd} -name ${fileName} -type f`, { encoding: "utf8" }).split("\n");
-
- if (pathString && pathString[0] && fileExistsSync(pathString[0].trim())) {
- pathString = path.normalize(pathString[0].trim());
- } else {
- pathString = null;
- }
- } catch (ex) {
- // Ignore the errors.
- }
- return pathString;
-}
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license.
+
+import * as childProcess from "child_process";
+import * as path from "path";
+import { directoryExistsSync, fileExistsSync, resolveMacArduinoAppPath } from "../util";
+
+export function resolveArduinoPath(): string {
+ let result;
+
+ const defaultCommonPaths = [path.join(process.env.HOME, "Applications"), "/Applications"];
+ for (const scanPath of defaultCommonPaths) {
+ if (directoryExistsSync(path.join(scanPath, "Arduino.app"))) {
+ result = scanPath;
+ break;
+ }
+ }
+ return result || "";
+}
+
+export function validateArduinoPath(arduinoPath: string, useArduinoCli = false): boolean {
+ return fileExistsSync(path.join(resolveMacArduinoAppPath(arduinoPath, useArduinoCli), useArduinoCli ? "arduino-cli" : "/Contents/MacOS/Arduino"));
+}
+
+export function findFile(fileName: string, cwd: string): string {
+ let pathString;
+ try {
+ pathString = childProcess.execSync(`find ${cwd} -name ${fileName} -type f`, { encoding: "utf8" }).split("\n");
+
+ if (pathString && pathString[0] && fileExistsSync(pathString[0].trim())) {
+ pathString = path.normalize(pathString[0].trim());
+ } else {
+ pathString = null;
+ }
+ } catch (ex) {
+ // Ignore the errors.
+ }
+ return pathString;
+}
diff --git a/src/common/util.ts b/src/common/util.ts
index 4445d0de..b82aa422 100644
--- a/src/common/util.ts
+++ b/src/common/util.ts
@@ -426,8 +426,8 @@ export function convertToHex(number, width = 0) {
* in case you named Arduino with a version number
* @argument {string} arduinoPath
*/
-export function resolveMacArduinoAppPath(arduinoPath: string): string {
- if (/Arduino.*\.app/.test(arduinoPath)) {
+export function resolveMacArduinoAppPath(arduinoPath: string, useArduinoCli = false): string {
+ if (useArduinoCli || /Arduino.*\.app/.test(arduinoPath)) {
return arduinoPath;
} else {
return path.join(arduinoPath, "Arduino.app");
diff --git a/src/deviceContext.ts b/src/deviceContext.ts
index 16451a81..0cfaa358 100644
--- a/src/deviceContext.ts
+++ b/src/deviceContext.ts
@@ -112,7 +112,7 @@ export class DeviceContext implements IDeviceContext, vscode.Disposable {
this._watcher.onDidDelete(() => this.loadContext());
this._vscodeWatcher.onDidDelete(() => this.loadContext());
this._sketchStatusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, constants.statusBarPriority.SKETCH);
- this._sketchStatusBar.command = "arduino.setSketchFile";
+ this._sketchStatusBar.command = "arduino.selectSketch";
this._sketchStatusBar.tooltip = "Sketch File";
}
}
diff --git a/src/extension.ts b/src/extension.ts
index 6ae7b0df..b4f6f456 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -156,24 +156,40 @@ export async function activate(context: vscode.ExtensionContext) {
return { board: arduinoContextModule.default.boardManager.currentBoard.name };
});
- registerArduinoCommand("arduino.setSketchFile", async () => {
+ registerArduinoCommand("arduino.selectSketch", async () => {
const sketchFileName = deviceContext.sketch;
- const newSketchFileName = await vscode.window.showInputBox({
- placeHolder: sketchFileName,
- validateInput: (value) => {
- if (value && /\.((ino)|(cpp)|c)$/.test(value.trim())) {
- return null;
- } else {
- return "Invalid sketch file name. Should be *.ino/*.cpp/*.c";
- }
- },
- });
+
+ // Include any ino, cpp, or c files under the workspace folder
+ const includePattern = "**/*.{ino,cpp,c}";
+
+ // The sketchbook folder may contain hardware & library folders, any sketches under these paths
+ // should be excluded
+ const sketchbookPath = arduinoContextModule.default.arduinoApp.settings.sketchbookPath;
+ const excludePatterns = [
+ path.relative(ArduinoWorkspace.rootPath, sketchbookPath + "/hardware/**"),
+ path.relative(ArduinoWorkspace.rootPath, sketchbookPath + "/libraries/**")];
+
+ // If an output path is specified, it should be excluded as well
+ if (deviceContext.output) {
+ const outputPath = path.relative(ArduinoWorkspace.rootPath,
+ path.resolve(ArduinoWorkspace.rootPath, deviceContext.output));
+ excludePatterns.push(`${outputPath}/**`);
+ }
+ const excludePattern = `{${excludePatterns.map((p) => p.replace("\\", "/")).join(",")}}`;
+
+ const fileUris = await vscode.workspace.findFiles(includePattern, excludePattern);
+ const newSketchFileName = await vscode.window.showQuickPick(fileUris.map((fileUri) =>
+ ({
+ label: path.relative(ArduinoWorkspace.rootPath, fileUri.fsPath),
+ description: fileUri.fsPath,
+ })),
+ { placeHolder: sketchFileName, matchOnDescription: true });
if (!newSketchFileName) {
return;
}
- deviceContext.sketch = newSketchFileName;
+ deviceContext.sketch = newSketchFileName.label;
deviceContext.showStatusBar();
});
diff --git a/src/views/package-lock.json b/src/views/package-lock.json
index 3a4e101d..5e30cfbf 100644
--- a/src/views/package-lock.json
+++ b/src/views/package-lock.json
@@ -843,12 +843,6 @@
"yallist": "^3.0.2"
}
},
- "y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
- "dev": true
- },
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
@@ -1683,24 +1677,24 @@
}
},
"elliptic": {
- "version": "6.5.3",
- "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
- "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
+ "version": "6.5.4",
+ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
+ "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
"dev": true,
"requires": {
- "bn.js": "^4.4.0",
- "brorand": "^1.0.1",
+ "bn.js": "^4.11.9",
+ "brorand": "^1.1.0",
"hash.js": "^1.0.0",
- "hmac-drbg": "^1.0.0",
- "inherits": "^2.0.1",
- "minimalistic-assert": "^1.0.0",
- "minimalistic-crypto-utils": "^1.0.0"
+ "hmac-drbg": "^1.0.1",
+ "inherits": "^2.0.4",
+ "minimalistic-assert": "^1.0.1",
+ "minimalistic-crypto-utils": "^1.0.1"
},
"dependencies": {
"bn.js": {
- "version": "4.11.9",
- "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
- "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+ "version": "4.12.0",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
"dev": true
}
}
@@ -6414,9 +6408,9 @@
"dev": true
},
"y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
+ "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"dev": true
},
"yallist": {
diff --git a/test/extension.test.ts b/test/extension.test.ts
index fb746313..6c91b0e9 100644
--- a/test/extension.test.ts
+++ b/test/extension.test.ts
@@ -54,7 +54,7 @@ suite("Arduino: Extension Tests", () => {
"arduino.showExampleExplorer",
"arduino.loadPackages",
"arduino.installBoard",
- "arduino.setSketchFile",
+ "arduino.selectSketch",
"arduino.cliUpload",
"arduino.cliUploadUsingProgrammer",
];