Skip to content

Commit ba9b10c

Browse files
committed
Merge branch 'release/v3.1.1'
2 parents 00dc225 + 2dd95dc commit ba9b10c

File tree

4 files changed

+42
-23
lines changed

4 files changed

+42
-23
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release Notes
22

3+
## 3.1.1 (2023-03-16)
4+
5+
* Added a new ``platformio-ide.uploadAndMonitor`` command which can be used with the custom [PlatformIO Toolbar](https://docs.platformio.org/en/latest/integration/ide/vscode.html#platformio-toolbar)
6+
* Restored support for macOS Touch Bar (issue [#3659](https://github.com/platformio/platformio-vscode-ide/issues/3659))
7+
* Fixed a regression bug that caused notifications about a task being "already active" when running the same "device monitor" (issue [#3656](https://github.com/platformio/platformio-vscode-ide/issues/3656))
8+
39
## 3.1.0 (2023-03-13)
410

511
* Add support for the ``${command:platformio-ide.activeEnvironment}`` variable that can be used in a custom [PlatformIO Toolbar](https://docs.platformio.org/en/latest/integration/ide/vscode.html#platformio-toolbar) and [VSCode variable substitution](https://code.visualstudio.com/docs/editor/variables-reference) (issue [#3588](https://github.com/platformio/platformio-vscode-ide/issues/3588))

package.json

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "platformio-ide",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"publisher": "platformio",
55
"engines": {
66
"vscode": "^1.65.0"
@@ -36,7 +36,16 @@
3636
"url": "https://github.com/platformio/platformio-vscode-ide.git"
3737
},
3838
"activationEvents": [
39-
"workspaceContains:**/platformio.ini"
39+
"workspaceContains:**/platformio.ini",
40+
"onView:platformio-ide.quickAccess",
41+
"onView:platformio-ide.projectTasks",
42+
"onView:platformio-debug.peripherals",
43+
"onView:platformio-debug.registers",
44+
"onView:platformio-debug.memory",
45+
"onView:platformio-debug.disassembly",
46+
"onCommand:platformio-ide.showReleaseNotes",
47+
"onCommand:platformio-ide.showHome",
48+
"onCommand:platformio-ide.openPIOCoreCLI"
4049
],
4150
"contributes": {
4251
"languages": [
@@ -142,21 +151,28 @@
142151
},
143152
{
144153
"command": "platformio-ide.build",
145-
"title": "Build active environment",
154+
"title": "Build",
146155
"category": "PlatformIO",
147156
"icon": "$(check)",
148157
"enablement": "pioProjectReady"
149158
},
150159
{
151160
"command": "platformio-ide.upload",
152-
"title": "Upload active environment",
161+
"title": "Upload",
162+
"category": "PlatformIO",
163+
"icon": "$(arrow-right)",
164+
"enablement": "pioProjectReady"
165+
},
166+
{
167+
"command": "platformio-ide.uploadAndMonitor",
168+
"title": "Upload and Monitor",
153169
"category": "PlatformIO",
154170
"icon": "$(arrow-right)",
155171
"enablement": "pioProjectReady"
156172
},
157173
{
158174
"command": "platformio-ide.clean",
159-
"title": "Clean active environment",
175+
"title": "Clean",
160176
"category": "PlatformIO",
161177
"icon": "$(trashcan)",
162178
"enablement": "pioProjectReady"
@@ -875,8 +891,8 @@
875891
"platformio-vscode-debug": "~1.4.1"
876892
},
877893
"devDependencies": {
878-
"@babel/core": "~7.21.0",
879-
"@babel/eslint-parser": "~7.19.1",
894+
"@babel/core": "~7.21.3",
895+
"@babel/eslint-parser": "~7.21.3",
880896
"@babel/plugin-proposal-class-properties": "~7.18.6",
881897
"@babel/preset-env": "~7.20.2",
882898
"@types/node": "~14",
@@ -887,7 +903,7 @@
887903
"eslint-import-resolver-webpack": "~0.13.2",
888904
"eslint-plugin-import": "~2.27.5",
889905
"prettier": "~2.8.4",
890-
"webpack": "~5.76.1",
906+
"webpack": "~5.76.2",
891907
"webpack-cli": "~5.0.1"
892908
},
893909
"extensionDependencies": [

src/project/tasks.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export default class ProjectTaskManager {
9090
},
9191
}),
9292

93-
vscode.tasks.onDidStartTask((event) => this.onDidStartTask(event)),
9493
vscode.tasks.onDidEndTaskProcess((event) => this.onDidEndTaskProcess(event))
9594
);
9695

@@ -149,22 +148,15 @@ export default class ProjectTaskManager {
149148
}
150149

151150
runTask(task) {
151+
this._autoCloseSerialMonitor(task);
152152
// use string-based task defination for Win 7 // issue #3481
153153
vscode.commands.executeCommand(
154154
'workbench.action.tasks.runTask',
155155
`${ProjectTaskManager.PROVIDER_TYPE}: ${task.id}`
156156
);
157157
}
158158

159-
onDidStartTask(event) {
160-
this._autoCloseSerialMonitor(event.execution.task);
161-
}
162-
163159
async _autoCloseSerialMonitor(startedTask) {
164-
if (startedTask.definition.type !== ProjectTaskManager.PROVIDER_TYPE) {
165-
return;
166-
}
167-
168160
this._startedTask = startedTask;
169161
this._tasksToRestore = [];
170162
const closeMonitorConds = [
@@ -186,18 +178,20 @@ export default class ProjectTaskManager {
186178
// }
187179

188180
vscode.tasks.taskExecutions.forEach((event) => {
189-
const isCurrentEvent = this.areTasksEqual(this._startedTask, event.task);
181+
const isCurrentTask = this.areTasksEqual(this._startedTask, event.task);
190182
const skipConds = [
191-
isCurrentEvent,
192183
// skip non-PlatformIO task
193184
event.task.definition.type !== ProjectTaskManager.PROVIDER_TYPE,
194185
!this.getTaskArgs(event.task).includes('monitor'),
195-
this.isMonitorAndUploadTask(event.task),
186+
this.isMonitorAndUploadTask(event.task) && !isCurrentTask,
196187
];
197188
if (skipConds.some((value) => value)) {
198189
return;
199190
}
200-
this._tasksToRestore.push(event.task);
191+
// do not restart the same tasks
192+
if (!isCurrentTask) {
193+
this._tasksToRestore.push(event.task);
194+
}
201195
event.terminate();
202196
});
203197
}
@@ -255,6 +249,9 @@ export default class ProjectTaskManager {
255249
vscode.commands.registerCommand('platformio-ide.upload', () =>
256250
_runTask('Upload')
257251
),
252+
vscode.commands.registerCommand('platformio-ide.uploadAndMonitor', () =>
253+
_runTask('Upload and Monitor')
254+
),
258255
vscode.commands.registerCommand('platformio-ide.clean', () => _runTask('Clean')),
259256
vscode.commands.registerCommand('platformio-ide.test', () => _runTask('Test')),
260257
vscode.commands.registerCommand('platformio-ide.serialMonitor', () =>

src/release-notes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ export default class PIOReleaseNotes {
116116
<p id="content">Loading...</p>
117117
<h2>Stay in touch with us</h2>
118118
<p>
119-
Please follow us on <a href="https://www.linkedin.com/company/platformio">LinkedIn</a> and Twitter <a href="https://twitter.com/PlatformIO_Org">@PlatformIO_Org]</a>
119+
Please follow us on <a href="https://www.linkedin.com/company/platformio">LinkedIn</a> and Twitter <a href="https://twitter.com/PlatformIO_Org">@PlatformIO_Org</a>
120120
to keep up to date with the latest news, articles and tips!
121121
</p>
122122
<hr />
123123
<p>
124124
<b>PlatformIO Core</b>: If you would like to read the PlatformIO Core release notes,
125-
go to the <a href="https://docs.platformio.org/en/latest/core/history.html">Release Notes</a> on <a href="https://docs.platformio.org/">docs.platformio.org</a>).
125+
go to the <a href="https://docs.platformio.org/en/latest/core/history.html">Release Notes</a> on <a href="https://docs.platformio.org/">docs.platformio.org</a>.
126126
</p>
127127
<textarea id="pioRNMarkdown" hidden="hidden">${releaseNotes}</textarea>
128128
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>

0 commit comments

Comments
 (0)