Skip to content

Commit 118bca4

Browse files
v1.10 Release (#1519)
* add version changes * rm empty entry * rm duplicated idf setups * update IDF_TARGET after idf set target task finish * fix size task execution validation * sdkconfig delete use customExtraVars IDF_TARGET instead * delete managed_components by default * use isSettingIDFTarget to show idf_target mismatch instead * update timeout py adapter * move isSettingIDFTarget to parent function
1 parent 94413ae commit 118bca4

File tree

12 files changed

+149
-77
lines changed

12 files changed

+149
-77
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@
88

99
All notable changes to the "Espressif IDF" extension will be documented in this file.
1010

11+
## [1.10.0](https://github.com/espressif/vscode-esp-idf-extension/releases/tag/v1.10.0)
12+
13+
### Features and enhancements
14+
15+
- [Add command to delete esp-idf specific settings](https://github.com/espressif/vscode-esp-idf-extension/pull/1353)
16+
- [Add idf.monitorPort setting](https://github.com/espressif/vscode-esp-idf-extension/pull/1429)
17+
- [Add idf.jtagFlashCommandExtraArgs](https://github.com/espressif/vscode-esp-idf-extension/pull/1450)
18+
- [Use idf qemu and idf.qemuExtraArgs for debug and monitor ](https://github.com/espressif/vscode-esp-idf-extension/pull/1462)
19+
- [App bootloader partition table build flash cmds, read Partition from device, partition specific flashing](https://github.com/espressif/vscode-esp-idf-extension/pull/1436)
20+
21+
### Bug Fixes
22+
23+
- [Russian translation typos fix](https://github.com/espressif/vscode-esp-idf-extension/pull/1409) Thanks @SinglWolf !
24+
- [Fix esp_idf.json setup not recognized](https://github.com/espressif/vscode-esp-idf-extension/pull/1451)
25+
- [Quotes for export script in IDF Terminal](https://github.com/espressif/vscode-esp-idf-extension/pull/1428)
26+
- [Fix preFlashTask in multiples profiles projects](https://github.com/espressif/vscode-esp-idf-extension/pull/1441)
27+
- [Add web extension debug and other documentation](https://github.com/espressif/vscode-esp-idf-extension/pull/1453)
28+
- [Fix openOCD arguments order](https://github.com/espressif/vscode-esp-idf-extension/pull/1482)
29+
- [Fix project configuration documents](https://github.com/espressif/vscode-esp-idf-extension/pull/1480)
30+
- [Fix create example project from Components registry](https://github.com/espressif/vscode-esp-idf-extension/pull/1485)
31+
- [Use remoteName to detect Codespaces environment](https://github.com/espressif/vscode-esp-idf-extension/pull/1483)
32+
- [Use 2 spaces for tab size on created json files](https://github.com/espressif/vscode-esp-idf-extension/pull/1510)
33+
- [Ensure build directory exists resolve workspaceFolder paths in Project Configuration editor](https://github.com/espressif/vscode-esp-idf-extension/pull/1417)
34+
- [Fix build flash monitor release serial port](https://github.com/espressif/vscode-esp-idf-extension/pull/1502)
35+
- [Merge env vars and add IDF_TARGET in Project Configuration Editor and New Project Wizard](https://github.com/espressif/vscode-esp-idf-extension/pull/1498)
36+
1137
## [1.9.1](https://github.com/espressif/vscode-esp-idf-extension/releases/tag/v1.9.1)
1238

1339
### Bug Fixes

docs_espressif/en/settings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Extension Behaviour Settings
187187
* - **idf.telemetry**
188188
- Enable telemetry
189189
* - **idf.deleteComponentsOnFullClean**
190-
- Delete ``managed_components`` on **Full Clean Project** command (default ``false``)
190+
- Delete ``managed_components`` on **Full Clean Project** command (default ``true``)
191191
* - **idf.monitorNoReset**
192192
- Enable no-reset flag to IDF Monitor (default ``false``)
193193
* - **idf.monitorEnableTimestamps**

docs_espressif/zh_CN/settings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ESP-IDF 相关设置
185185
* - **idf.telemetry**
186186
- 启用遥测
187187
* - **idf.deleteComponentsOnFullClean**
188-
- 在执行 **Full Clean Project** 命令时删除 ``managed_components`` (该选项默认禁用
188+
- 在执行 **Full Clean Project** 命令时删除 ``managed_components`` (该选项默认启用
189189
* - **idf.monitorNoReset**
190190
- 启用 IDF 监视器的不重置标志(该选项默认禁用)
191191
* - **idf.monitorEnableTimestamps**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@
10871087
},
10881088
"idf.deleteComponentsOnFullClean": {
10891089
"type": "boolean",
1090-
"default": false,
1090+
"default": true,
10911091
"scope": "resource",
10921092
"description": "%param.deleteComponentsOnFullClean%"
10931093
},

src/build/buildCmd.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ import * as vscode from "vscode";
2323
import { Logger } from "../logger/logger";
2424
import { TaskManager } from "../taskManager";
2525
import { join } from "path";
26-
import { getIdfTargetFromSdkconfig, updateIdfComponentsTree } from "../workspaceConfig";
26+
import {
27+
getIdfTargetFromSdkconfig,
28+
updateIdfComponentsTree,
29+
} from "../workspaceConfig";
2730
import { IdfSizeTask } from "../espIdf/size/idfSizeTask";
2831
import { CustomTask, CustomTaskType } from "../customTasks/customTaskProvider";
2932
import { readParameter } from "../idfConfiguration";
@@ -64,7 +67,7 @@ export async function buildCommand(
6467
"idf.enableSizeTaskAfterBuildTask",
6568
workspace
6669
)) as boolean;
67-
if (enableSizeTask && typeof buildType === undefined) {
70+
if (enableSizeTask && typeof buildType === "undefined") {
6871
const sizeTask = new IdfSizeTask(workspace);
6972
await sizeTask.getSizeInfo();
7073
}
@@ -78,7 +81,11 @@ export async function buildCommand(
7881
);
7982
}
8083
const adapterTargetName = await getIdfTargetFromSdkconfig(workspace);
81-
if (adapterTargetName && adapterTargetName !== "esp32s2" && adapterTargetName !== "esp32s3") {
84+
if (
85+
adapterTargetName &&
86+
adapterTargetName !== "esp32s2" &&
87+
adapterTargetName !== "esp32s3"
88+
) {
8289
return Logger.warnNotify(
8390
`The selected device target "${adapterTargetName}" is not compatible for DFU, as a result the DFU.bin was not created.`
8491
);
@@ -96,7 +103,11 @@ export async function buildCommand(
96103
}
97104
} catch (error) {
98105
if (error.message === "ALREADY_BUILDING") {
99-
return Logger.errorNotify("Already a build is running!", error, "buildCommand");
106+
return Logger.errorNotify(
107+
"Already a build is running!",
108+
error,
109+
"buildCommand"
110+
);
100111
}
101112
if (error.message === "BUILD_TERMINATED") {
102113
return Logger.warnNotify(`Build is Terminated`);
@@ -114,13 +125,8 @@ export async function buildCommand(
114125
return continueFlag;
115126
}
116127

117-
118-
119128
export async function buildFinishFlashCmd(workspace: vscode.Uri) {
120-
const buildPath = readParameter(
121-
"idf.buildPath",
122-
workspace
123-
) as string;
129+
const buildPath = readParameter("idf.buildPath", workspace) as string;
124130
const flasherArgsPath = join(buildPath, "flasher_args.json");
125131
const flasherArgsExists = await pathExists(flasherArgsPath);
126132
if (!flasherArgsExists) {

src/espIdf/setTarget/index.ts

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import { getTargetsFromEspIdf } from "./getTargets";
3636
import { setTargetInIDF } from "./setTargetInIdf";
3737
import { updateCurrentProfileIdfTarget } from "../../project-conf";
3838

39+
export let isSettingIDFTarget = false;
40+
3941
export async function setIdfTarget(
4042
placeHolderMsg: string,
4143
workspaceFolder: WorkspaceFolder
@@ -44,6 +46,11 @@ export async function setIdfTarget(
4446
if (!workspaceFolder) {
4547
return;
4648
}
49+
if (isSettingIDFTarget) {
50+
Logger.info("setTargetInIDF is already running.");
51+
return;
52+
}
53+
isSettingIDFTarget = true;
4754

4855
const notificationMode = readParameter(
4956
"idf.notificationMode",
@@ -67,18 +74,6 @@ export async function setIdfTarget(
6774
if (!selectedTarget) {
6875
return;
6976
}
70-
const customExtraVars = readParameter(
71-
"idf.customExtraVars",
72-
workspaceFolder
73-
) as { [key: string]: string };
74-
customExtraVars["IDF_TARGET"] = selectedTarget.target;
75-
await writeParameter(
76-
"idf.customExtraVars",
77-
customExtraVars,
78-
configurationTarget,
79-
workspaceFolder.uri
80-
);
81-
await updateCurrentProfileIdfTarget(selectedTarget.target, workspaceFolder.uri);
8277
const openOcdScriptsPath = await getOpenOcdScripts(workspaceFolder.uri);
8378
const boards = await getBoards(
8479
openOcdScriptsPath,
@@ -98,7 +93,9 @@ export async function setIdfTarget(
9893
Logger.infoNotify(
9994
`ESP-IDF board not selected. Remember to set the configuration files for OpenOCD with idf.openOcdConfigs`
10095
);
101-
} else if (selectedBoard && selectedBoard.target) {
96+
}
97+
await setTargetInIDF(workspaceFolder, selectedTarget);
98+
if (selectedBoard && selectedBoard.target) {
10299
if (selectedBoard.label.indexOf("Custom board") !== -1) {
103100
const inputBoard = await window.showInputBox({
104101
placeHolder: "Enter comma-separated configuration files",
@@ -115,7 +112,22 @@ export async function setIdfTarget(
115112
workspaceFolder.uri
116113
);
117114
}
118-
await setTargetInIDF(workspaceFolder, selectedTarget);
115+
116+
const customExtraVars = readParameter(
117+
"idf.customExtraVars",
118+
workspaceFolder
119+
) as { [key: string]: string };
120+
customExtraVars["IDF_TARGET"] = selectedTarget.target;
121+
await writeParameter(
122+
"idf.customExtraVars",
123+
customExtraVars,
124+
configurationTarget,
125+
workspaceFolder.uri
126+
);
127+
await updateCurrentProfileIdfTarget(
128+
selectedTarget.target,
129+
workspaceFolder.uri
130+
);
119131
} catch (err) {
120132
const errMsg =
121133
err instanceof Error
@@ -129,6 +141,8 @@ export async function setIdfTarget(
129141
Logger.errorNotify(errMsg, err, "setIdfTarget");
130142
OutputChannel.appendLine(errMsg);
131143
}
144+
} finally {
145+
isSettingIDFTarget = false;
132146
}
133147
}
134148
);

src/espIdf/setTarget/setTargetInIdf.ts

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,44 +35,46 @@ export async function setTargetInIDF(
3535
workspaceFolder: WorkspaceFolder,
3636
selectedTarget: IdfTarget
3737
) {
38-
if (ConfserverProcess.exists()) {
39-
ConfserverProcess.dispose();
40-
}
41-
const idfPathDir = readParameter("idf.espIdfPath", workspaceFolder.uri);
42-
const buildDirPath = readParameter(
43-
"idf.buildPath",
44-
workspaceFolder.uri
45-
) as string;
46-
const idfPy = join(idfPathDir, "tools", "idf.py");
47-
const modifiedEnv = await appendIdfAndToolsToPath(workspaceFolder.uri);
48-
modifiedEnv.IDF_TARGET = undefined;
49-
const enableCCache = readParameter(
50-
"idf.enableCCache",
51-
workspaceFolder.uri
52-
) as boolean;
53-
const setTargetArgs: string[] = [idfPy];
54-
if (selectedTarget.isPreview) {
55-
setTargetArgs.push("--preview");
56-
}
57-
setTargetArgs.push("-B", buildDirPath);
58-
if (enableCCache) {
59-
modifiedEnv.IDF_CCACHE_ENABLE = "1";
60-
} else {
61-
modifiedEnv.IDF_CCACHE_ENABLE = undefined;
62-
}
63-
if (modifiedEnv.SDKCONFIG) {
64-
setTargetArgs.push(`-DSDKCONFIG='${modifiedEnv.SDKCONFIG}'`);
65-
}
66-
const sdkconfigDefaults =
67-
(readParameter("idf.sdkconfigDefaults") as string[]) || [];
38+
try {
39+
if (ConfserverProcess.exists()) {
40+
ConfserverProcess.dispose();
41+
}
42+
const idfPathDir = readParameter("idf.espIdfPath", workspaceFolder.uri);
43+
const buildDirPath = readParameter(
44+
"idf.buildPath",
45+
workspaceFolder.uri
46+
) as string;
47+
const idfPy = join(idfPathDir, "tools", "idf.py");
48+
const modifiedEnv = await appendIdfAndToolsToPath(workspaceFolder.uri);
49+
modifiedEnv.IDF_TARGET = undefined;
50+
const enableCCache = readParameter(
51+
"idf.enableCCache",
52+
workspaceFolder.uri
53+
) as boolean;
54+
const setTargetArgs: string[] = [idfPy];
55+
if (selectedTarget.isPreview) {
56+
setTargetArgs.push("--preview");
57+
}
58+
setTargetArgs.push("-B", buildDirPath);
59+
if (enableCCache) {
60+
modifiedEnv.IDF_CCACHE_ENABLE = "1";
61+
} else {
62+
modifiedEnv.IDF_CCACHE_ENABLE = undefined;
63+
}
64+
if (modifiedEnv.SDKCONFIG) {
65+
setTargetArgs.push(`-DSDKCONFIG='${modifiedEnv.SDKCONFIG}'`);
66+
}
67+
const sdkconfigDefaults =
68+
(readParameter("idf.sdkconfigDefaults") as string[]) || [];
6869

69-
if (sdkconfigDefaults && sdkconfigDefaults.length) {
70-
setTargetArgs.push(`-DSDKCONFIG_DEFAULTS='${sdkconfigDefaults.join(";")}'`);
71-
}
70+
if (sdkconfigDefaults && sdkconfigDefaults.length) {
71+
setTargetArgs.push(
72+
`-DSDKCONFIG_DEFAULTS='${sdkconfigDefaults.join(";")}'`
73+
);
74+
}
7275

73-
setTargetArgs.push("set-target", selectedTarget.target);
74-
const pythonBinPath = await getVirtualEnvPythonPath(workspaceFolder.uri);
75-
try {
76+
setTargetArgs.push("set-target", selectedTarget.target);
77+
const pythonBinPath = await getVirtualEnvPythonPath(workspaceFolder.uri);
7678
const setTargetResult = await spawn(pythonBinPath, setTargetArgs, {
7779
cwd: workspaceFolder.uri.fsPath,
7880
env: modifiedEnv,

src/extension.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export async function activate(context: vscode.ExtensionContext) {
445445
break;
446446
}
447447
}
448-
if (typeof workspaceRoot === undefined) {
448+
if (typeof workspaceRoot === "undefined") {
449449
workspaceRoot = initSelectedWorkspace(statusBarItems["workspace"]);
450450
ESP.GlobalConfiguration.store.set(
451451
ESP.GlobalConfiguration.SELECTED_WORKSPACE_FOLDER,
@@ -3839,7 +3839,14 @@ async function getFrameworksPickItems() {
38393839
);
38403840
existingIdfSetups = [...existingIdfSetups, ...systemIdfSetups];
38413841
}
3842-
const setupsToUse = [...idfSetups, ...existingIdfSetups];
3842+
let setupsToUse = [...idfSetups, ...existingIdfSetups];
3843+
setupsToUse = setupsToUse.filter(
3844+
(setup, index, self) =>
3845+
index ===
3846+
self.findIndex(
3847+
(s) => s.idfPath === setup.idfPath && s.toolsPath === setup.toolsPath
3848+
)
3849+
);
38433850
if (!setupsToUse || setupsToUse.length === 0) {
38443851
await vscode.window.showInformationMessage("No ESP-IDF Setups found");
38453852
return;

src/newProject/newProjectInit.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ export async function getNewProjectArgs(
8080
);
8181
existingIdfSetups = [...existingIdfSetups, ...systemIdfSetups];
8282
}
83-
const setupsToUse = [...idfSetups, ...existingIdfSetups];
83+
let setupsToUse = [...idfSetups, ...existingIdfSetups];
84+
setupsToUse = setupsToUse.filter(
85+
(setup, index, self) =>
86+
index ===
87+
self.findIndex(
88+
(s) => s.idfPath === setup.idfPath && s.toolsPath === setup.toolsPath
89+
)
90+
);
8491
if (setupsToUse.length === 0) {
8592
await window.showInformationMessage("No ESP-IDF Setups found");
8693
return;

src/test/adapter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ suite("Debug Adapter Tests", () => {
5656
response.body = response.body || {};
5757
assert.equal(response.body.supportsConfigurationDoneRequest, true);
5858
});
59-
});
59+
}).timeout(10000);
6060
});
6161
});

0 commit comments

Comments
 (0)