Skip to content

Commit badebbe

Browse files
Bugfix/tarxz install (#1118)
* fix tar xz installs * add p4 to keywords * update progress windows with idf notificationMode * update debug task tasks json template
1 parent 25bca1b commit badebbe

File tree

20 files changed

+472
-68
lines changed

20 files changed

+472
-68
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"ESP32-C2",
3737
"ESP32-C3",
3838
"ESP32-H2",
39+
"ESP32-P4",
3940
"ESP32-S2",
4041
"ESP32-S3",
4142
"esp32",
@@ -45,6 +46,7 @@
4546
"esp32h2",
4647
"esp32s2",
4748
"esp32s3",
49+
"esp32p4",
4850
"matter",
4951
"iot",
5052
"wifi",

src/checkExtensionSettings.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ import {
2121
isCurrentInstallValid,
2222
} from "./setup/setupInit";
2323
import { Logger } from "./logger/logger";
24-
import { readParameter } from "./idfConfiguration";
24+
import { NotificationMode, readParameter } from "./idfConfiguration";
2525
import { useIdfSetupSettings } from "./setup/setupValidation/espIdfSetup";
26-
import { getIdfMd5sum } from "./setup/espIdfJson";
27-
import { getEspIdfFromCMake } from "./utils";
28-
import { IdfSetup } from "./views/setup/types";
2926

3027
export async function checkExtensionSettings(
3128
extensionPath: string,
@@ -40,10 +37,19 @@ export async function checkExtensionSettings(
4037
vscode.commands.executeCommand("espIdf.welcome.start");
4138
return;
4239
}
40+
const notificationMode = readParameter(
41+
"idf.notificationMode",
42+
workspace
43+
) as string;
44+
const ProgressLocation =
45+
notificationMode === NotificationMode.All ||
46+
notificationMode === NotificationMode.Notifications
47+
? vscode.ProgressLocation.Notification
48+
: vscode.ProgressLocation.Window;
4349
await vscode.window.withProgress(
4450
{
4551
cancellable: false,
46-
location: vscode.ProgressLocation.Notification,
52+
location: ProgressLocation,
4753
title: "ESP-IDF: Loading initial configuration...",
4854
},
4955
async (

src/common/abstractCloning.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,18 @@ export class AbstractCloning {
159159
Logger.infoNotify(`${resultingPath} already exist.`);
160160
return;
161161
}
162+
const notificationMode = idfConf.readParameter(
163+
"idf.notificationMode"
164+
) as string;
165+
const progressLocation =
166+
notificationMode === idfConf.NotificationMode.All ||
167+
notificationMode === idfConf.NotificationMode.Notifications
168+
? ProgressLocation.Notification
169+
: ProgressLocation.Window;
162170
await window.withProgress(
163171
{
164172
cancellable: true,
165-
location: ProgressLocation.Notification,
173+
location: progressLocation,
166174
title: this.name,
167175
},
168176
async (
@@ -368,10 +376,18 @@ export class AbstractCloning {
368376
public async getSubmodules(repoRootDir: string) {
369377
const repoName = /[^/]*$/.exec(repoRootDir)[0];
370378
OutputChannel.appendLine(`Downloading ${repoName} submodules`);
379+
const notificationMode = idfConf.readParameter(
380+
"idf.notificationMode"
381+
) as string;
382+
const progressLocation =
383+
notificationMode === idfConf.NotificationMode.All ||
384+
notificationMode === idfConf.NotificationMode.Notifications
385+
? ProgressLocation.Notification
386+
: ProgressLocation.Window;
371387
await window.withProgress(
372388
{
373389
cancellable: true,
374-
location: ProgressLocation.Notification,
390+
location: progressLocation,
375391
title: `Checking out ${repoName} submodules`,
376392
},
377393
async (

src/component-manager/panel.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import { join } from "path";
2020
import { Disposable, Uri, ViewColumn, WebviewPanel, window } from "vscode";
2121
import { ESP } from "../config";
22-
import { readParameter } from "../idfConfiguration";
22+
import { NotificationMode, readParameter } from "../idfConfiguration";
2323
import { addDependency, createProject } from "./utils";
2424
import * as vscode from "vscode";
2525

@@ -87,7 +87,7 @@ export class ComponentManagerUIPanel {
8787
this.extensionPath = extensionPath;
8888
this.panel.onDidDispose(() => this.dispose(), null, this.disposable);
8989
this.panel.webview.onDidReceiveMessage(
90-
async (message) => this.onMessage(message),
90+
async (message) => this.onMessage(message, workspaceRoot),
9191
null,
9292
this.disposable
9393
);
@@ -97,7 +97,7 @@ export class ComponentManagerUIPanel {
9797
this.panel.webview.html = this.initWebView(url);
9898
}
9999

100-
private async onMessage(message: IMessage) {
100+
private async onMessage(message: IMessage, workspaceUri: Uri) {
101101
switch (message.message) {
102102
case "install":
103103
if (!message.dependency) return;
@@ -117,9 +117,18 @@ export class ComponentManagerUIPanel {
117117
if (!selectedFolder) {
118118
return;
119119
}
120+
const notificationMode = readParameter(
121+
"idf.notificationMode",
122+
workspaceUri
123+
) as string;
124+
const ProgressLocation =
125+
notificationMode === NotificationMode.All ||
126+
notificationMode === NotificationMode.Notifications
127+
? vscode.ProgressLocation.Notification
128+
: vscode.ProgressLocation.Window;
120129
await vscode.window.withProgress(
121130
{
122-
location: vscode.ProgressLocation.Notification,
131+
location: ProgressLocation,
123132
title: "ESP-IDF: Creating project...",
124133
cancellable: false,
125134
},

src/coverage/configureProject.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import { extensionContext, getConfigValueFromSDKConfig, getEspIdfFromCMake } from "../utils";
20-
import { readParameter } from "../idfConfiguration";
20+
import { NotificationMode, readParameter } from "../idfConfiguration";
2121
import { ConfserverProcess } from "../espIdf/menuconfig/confServerProcess";
2222
import {
2323
env,
@@ -81,10 +81,19 @@ export async function configureProjectWithGcov(workspacePath: Uri) {
8181
if (response !== "Start") {
8282
return;
8383
}
84+
const notificationMode = readParameter(
85+
"idf.notificationMode",
86+
workspacePath
87+
) as string;
88+
const progressLocation =
89+
notificationMode === NotificationMode.All ||
90+
notificationMode === NotificationMode.Notifications
91+
? ProgressLocation.Notification
92+
: ProgressLocation.Window;
8493
await window.withProgress(
8594
{
8695
cancellable: true,
87-
location: ProgressLocation.Notification,
96+
location: progressLocation,
8897
title: "ESP-IDF: Configuring coverage",
8998
},
9099
async (

src/espIdf/menuconfig/MenuconfigPanel.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Logger } from "../../logger/logger";
1919
import { getWebViewFavicon } from "../../utils";
2020
import { ConfserverProcess } from "./confServerProcess";
2121
import { Menu } from "./Menu";
22+
import { NotificationMode, readParameter } from "../../idfConfiguration";
2223

2324
const locDic = new LocDictionary(__filename);
2425

@@ -136,7 +137,9 @@ export class MenuConfigPanel {
136137
this.panel.webview.onDidReceiveMessage(async (message) => {
137138
switch (message.command) {
138139
case "updateValue":
139-
ConfserverProcess.setUpdatedValue(JSON.parse(message.updated_value) as Menu);
140+
ConfserverProcess.setUpdatedValue(
141+
JSON.parse(message.updated_value) as Menu
142+
);
140143
break;
141144
case "setDefault":
142145
const changesNotSavedMessage = locDic.localize(
@@ -153,10 +156,19 @@ export class MenuConfigPanel {
153156
{ title: noMsg, isCloseAffordance: true }
154157
);
155158
if (selected.title === yesMsg) {
159+
const notificationMode = readParameter(
160+
"idf.notificationMode",
161+
this.curWorkspaceFolder
162+
) as string;
163+
const ProgressLocation =
164+
notificationMode === NotificationMode.All ||
165+
notificationMode === NotificationMode.Notifications
166+
? vscode.ProgressLocation.Notification
167+
: vscode.ProgressLocation.Window;
156168
vscode.window.withProgress(
157169
{
158170
cancellable: true,
159-
location: vscode.ProgressLocation.Notification,
171+
location: ProgressLocation,
160172
title: "ESP-IDF: SDK Configuration editor",
161173
},
162174
async (

src/espIdf/partition-table/partitionFlasher.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import { basename, join } from "path";
2020
import { Progress, ProgressLocation, Uri, window } from "vscode";
21-
import { readParameter } from "../../idfConfiguration";
21+
import { NotificationMode, readParameter } from "../../idfConfiguration";
2222
import { Logger } from "../../logger/logger";
2323
import { appendIdfAndToolsToPath, spawn } from "../../utils";
2424
import { OutputChannel } from "../../logger/outputChannel";
@@ -28,10 +28,19 @@ export async function flashBinaryToPartition(
2828
binPath: string,
2929
workspaceFolder: Uri
3030
) {
31+
const notificationMode = readParameter(
32+
"idf.notificationMode",
33+
workspaceFolder
34+
) as string;
35+
const progressLocation =
36+
notificationMode === NotificationMode.All ||
37+
notificationMode === NotificationMode.Notifications
38+
? ProgressLocation.Notification
39+
: ProgressLocation.Window;
3140
await window.withProgress(
3241
{
3342
cancellable: false,
34-
location: ProgressLocation.Notification,
43+
location: progressLocation,
3544
title: "ESP-IDF: Flashing binary to device",
3645
},
3746
async (progress: Progress<{ message: string; increment: number }>) => {

src/espIdf/setTarget/index.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ import {
2222
ProgressLocation,
2323
window,
2424
} from "vscode";
25-
import { readParameter, writeParameter } from "../../idfConfiguration";
25+
import {
26+
NotificationMode,
27+
readParameter,
28+
writeParameter,
29+
} from "../../idfConfiguration";
2630
import { Logger } from "../../logger/logger";
2731
import { OutputChannel } from "../../logger/outputChannel";
2832
import { getBoards, getOpenOcdScripts } from "../openOcd/boardConfiguration";
@@ -38,10 +42,19 @@ export async function setIdfTarget(placeHolderMsg: string) {
3842
return;
3943
}
4044

45+
const notificationMode = readParameter(
46+
"idf.notificationMode",
47+
workspaceFolder
48+
) as string;
49+
const progressLocation =
50+
notificationMode === NotificationMode.All ||
51+
notificationMode === NotificationMode.Notifications
52+
? ProgressLocation.Notification
53+
: ProgressLocation.Window;
4154
await window.withProgress(
4255
{
4356
cancellable: false,
44-
location: ProgressLocation.Notification,
57+
location: progressLocation,
4558
title: "ESP-IDF: Setting device target...",
4659
},
4760
async (progress: Progress<{ message: string; increment: number }>) => {
@@ -86,7 +99,10 @@ export async function setIdfTarget(placeHolderMsg: string) {
8699
workspaceFolder.uri
87100
);
88101
const openOcdScriptsPath = getOpenOcdScripts(workspaceFolder.uri);
89-
const boards = await getBoards(selectedTarget.target, openOcdScriptsPath);
102+
const boards = await getBoards(
103+
selectedTarget.target,
104+
openOcdScriptsPath
105+
);
90106
const choices = boards.map((b) => {
91107
return {
92108
description: `${b.description} (${b.configFiles})`,

src/espIdf/tracing/system-view/parser.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,25 @@ import { AppTraceArchiveItems } from "../tree/appTraceArchiveTreeDataProvider";
2020
import { window, ProgressLocation } from "vscode";
2121
import { Logger } from "../../../logger/logger";
2222
import { SystemViewPanel } from "./panel";
23-
import { readJsonSync } from "fs-extra";
2423
import { SysviewTraceProc } from "../tools/sysviewTraceProc";
24+
import { NotificationMode, readParameter } from "../../../idfConfiguration";
2525

2626
export class SystemViewResultParser {
2727
public static parseWithProgress(
2828
trace: AppTraceArchiveItems,
2929
extensionPath: string
3030
) {
31+
const notificationMode = readParameter(
32+
"idf.notificationMode"
33+
) as string;
34+
const progressLocation =
35+
notificationMode === NotificationMode.All ||
36+
notificationMode === NotificationMode.Notifications
37+
? ProgressLocation.Notification
38+
: ProgressLocation.Window;
3139
window.withProgress(
3240
{
33-
location: ProgressLocation.Notification,
41+
location: progressLocation,
3442
cancellable: false,
3543
title:
3644
"ESP-IDF: Processing your tracing file to generate System View Report",

src/espMatter/espMatterDownload.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,24 @@ export class EspMatterCloning extends AbstractCloning {
140140
);
141141
}
142142

143-
public async initEsp32PlatformSubmodules(espMatterDir: string) {
143+
public async initEsp32PlatformSubmodules(
144+
espMatterDir: string,
145+
workspace: Uri
146+
) {
144147
OutputChannel.appendLine("Downloading Matter ESP32 platform submodules");
148+
const notificationMode = readParameter(
149+
"idf.notificationMode",
150+
workspace
151+
) as string;
152+
const progressLocation =
153+
notificationMode === NotificationMode.All ||
154+
notificationMode === NotificationMode.Notifications
155+
? ProgressLocation.Notification
156+
: ProgressLocation.Window;
145157
await window.withProgress(
146158
{
147159
cancellable: true,
148-
location: ProgressLocation.Notification,
160+
location: progressLocation,
149161
title: "ESP-IDF: Installing ESP-Matter",
150162
},
151163
async (
@@ -254,10 +266,19 @@ export async function installPythonReqs(
254266
confToolsPath ||
255267
process.env.IDF_TOOLS_PATH ||
256268
join(containerPath, ".espressif");
269+
const notificationMode = readParameter(
270+
"idf.notificationMode",
271+
workspace
272+
) as string;
273+
const progressLocation =
274+
notificationMode === NotificationMode.All ||
275+
notificationMode === NotificationMode.Notifications
276+
? ProgressLocation.Notification
277+
: ProgressLocation.Window;
257278
await window.withProgress(
258279
{
259280
cancellable: true,
260-
location: ProgressLocation.Notification,
281+
location: progressLocation,
261282
title: "ESP-IDF: Installing ESP-Matter",
262283
},
263284
async (
@@ -283,7 +304,7 @@ export async function installPythonReqs(
283304
export async function getEspMatter(workspace?: Uri) {
284305
const gitPath =
285306
(await readParameter("idf.gitPath", workspace)) || "/usr/bin/git";
286-
let espMatterPath;
307+
let espMatterPath: string;
287308
const espMatterInstaller = new EspMatterCloning(gitPath, workspace);
288309
const installAllSubmodules = await window.showQuickPick(
289310
[
@@ -312,7 +333,10 @@ export async function getEspMatter(workspace?: Uri) {
312333
);
313334
espMatterPath = readParameter("idf.espMatterPath", workspace);
314335
await espMatterInstaller.getSubmodules(espMatterPath);
315-
await espMatterInstaller.initEsp32PlatformSubmodules(espMatterPath);
336+
await espMatterInstaller.initEsp32PlatformSubmodules(
337+
espMatterPath,
338+
workspace
339+
);
316340
await espMatterInstaller.startBootstrap(true);
317341
}
318342
await TaskManager.runTasks();

0 commit comments

Comments
 (0)