Skip to content

Commit

Permalink
Merge branch 'release/v3.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Mar 17, 2023
2 parents 00dc225 + 2dd95dc commit ba9b10c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 3.1.1 (2023-03-16)

* 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)
* Restored support for macOS Touch Bar (issue [#3659](https://github.com/platformio/platformio-vscode-ide/issues/3659))
* 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))

## 3.1.0 (2023-03-13)

* 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))
Expand Down
32 changes: 24 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "platformio-ide",
"version": "3.1.0",
"version": "3.1.1",
"publisher": "platformio",
"engines": {
"vscode": "^1.65.0"
Expand Down Expand Up @@ -36,7 +36,16 @@
"url": "https://github.com/platformio/platformio-vscode-ide.git"
},
"activationEvents": [
"workspaceContains:**/platformio.ini"
"workspaceContains:**/platformio.ini",
"onView:platformio-ide.quickAccess",
"onView:platformio-ide.projectTasks",
"onView:platformio-debug.peripherals",
"onView:platformio-debug.registers",
"onView:platformio-debug.memory",
"onView:platformio-debug.disassembly",
"onCommand:platformio-ide.showReleaseNotes",
"onCommand:platformio-ide.showHome",
"onCommand:platformio-ide.openPIOCoreCLI"
],
"contributes": {
"languages": [
Expand Down Expand Up @@ -142,21 +151,28 @@
},
{
"command": "platformio-ide.build",
"title": "Build active environment",
"title": "Build",
"category": "PlatformIO",
"icon": "$(check)",
"enablement": "pioProjectReady"
},
{
"command": "platformio-ide.upload",
"title": "Upload active environment",
"title": "Upload",
"category": "PlatformIO",
"icon": "$(arrow-right)",
"enablement": "pioProjectReady"
},
{
"command": "platformio-ide.uploadAndMonitor",
"title": "Upload and Monitor",
"category": "PlatformIO",
"icon": "$(arrow-right)",
"enablement": "pioProjectReady"
},
{
"command": "platformio-ide.clean",
"title": "Clean active environment",
"title": "Clean",
"category": "PlatformIO",
"icon": "$(trashcan)",
"enablement": "pioProjectReady"
Expand Down Expand Up @@ -875,8 +891,8 @@
"platformio-vscode-debug": "~1.4.1"
},
"devDependencies": {
"@babel/core": "~7.21.0",
"@babel/eslint-parser": "~7.19.1",
"@babel/core": "~7.21.3",
"@babel/eslint-parser": "~7.21.3",
"@babel/plugin-proposal-class-properties": "~7.18.6",
"@babel/preset-env": "~7.20.2",
"@types/node": "~14",
Expand All @@ -887,7 +903,7 @@
"eslint-import-resolver-webpack": "~0.13.2",
"eslint-plugin-import": "~2.27.5",
"prettier": "~2.8.4",
"webpack": "~5.76.1",
"webpack": "~5.76.2",
"webpack-cli": "~5.0.1"
},
"extensionDependencies": [
Expand Down
23 changes: 10 additions & 13 deletions src/project/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export default class ProjectTaskManager {
},
}),

vscode.tasks.onDidStartTask((event) => this.onDidStartTask(event)),
vscode.tasks.onDidEndTaskProcess((event) => this.onDidEndTaskProcess(event))
);

Expand Down Expand Up @@ -149,22 +148,15 @@ export default class ProjectTaskManager {
}

runTask(task) {
this._autoCloseSerialMonitor(task);
// use string-based task defination for Win 7 // issue #3481
vscode.commands.executeCommand(
'workbench.action.tasks.runTask',
`${ProjectTaskManager.PROVIDER_TYPE}: ${task.id}`
);
}

onDidStartTask(event) {
this._autoCloseSerialMonitor(event.execution.task);
}

async _autoCloseSerialMonitor(startedTask) {
if (startedTask.definition.type !== ProjectTaskManager.PROVIDER_TYPE) {
return;
}

this._startedTask = startedTask;
this._tasksToRestore = [];
const closeMonitorConds = [
Expand All @@ -186,18 +178,20 @@ export default class ProjectTaskManager {
// }

vscode.tasks.taskExecutions.forEach((event) => {
const isCurrentEvent = this.areTasksEqual(this._startedTask, event.task);
const isCurrentTask = this.areTasksEqual(this._startedTask, event.task);
const skipConds = [
isCurrentEvent,
// skip non-PlatformIO task
event.task.definition.type !== ProjectTaskManager.PROVIDER_TYPE,
!this.getTaskArgs(event.task).includes('monitor'),
this.isMonitorAndUploadTask(event.task),
this.isMonitorAndUploadTask(event.task) && !isCurrentTask,
];
if (skipConds.some((value) => value)) {
return;
}
this._tasksToRestore.push(event.task);
// do not restart the same tasks
if (!isCurrentTask) {
this._tasksToRestore.push(event.task);
}
event.terminate();
});
}
Expand Down Expand Up @@ -255,6 +249,9 @@ export default class ProjectTaskManager {
vscode.commands.registerCommand('platformio-ide.upload', () =>
_runTask('Upload')
),
vscode.commands.registerCommand('platformio-ide.uploadAndMonitor', () =>
_runTask('Upload and Monitor')
),
vscode.commands.registerCommand('platformio-ide.clean', () => _runTask('Clean')),
vscode.commands.registerCommand('platformio-ide.test', () => _runTask('Test')),
vscode.commands.registerCommand('platformio-ide.serialMonitor', () =>
Expand Down
4 changes: 2 additions & 2 deletions src/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ export default class PIOReleaseNotes {
<p id="content">Loading...</p>
<h2>Stay in touch with us</h2>
<p>
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>
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>
to keep up to date with the latest news, articles and tips!
</p>
<hr />
<p>
<b>PlatformIO Core</b>: If you would like to read the PlatformIO Core release notes,
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>).
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>.
</p>
<textarea id="pioRNMarkdown" hidden="hidden">${releaseNotes}</textarea>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
Expand Down

0 comments on commit ba9b10c

Please sign in to comment.