Skip to content

Commit

Permalink
Add changelog for 1.9.0 release (#1348)
Browse files Browse the repository at this point in the history
* Add changelog for 1.9.0 release

* add flash monitor redirect in buildFlashMonitor command

* add validation for getEnvVarsFromIdfTools

* add IDF_PYTHON_ENV_PATH validation

* Bugfix/walkthrough documentation (#1354)

* Update post-installation step

* Collapse all menus except commands

* update activation init check settings

remove extension settings await

use showOnBoarding to show welcome page

increase timeout of notifications

increase notification timeout

disable show info message on check extension setting

fix lint

rm console log

* Use major + minor versions, remove patch version (#1360)

* add cmd pwsh idf py autocomplete

* add scripts to prettier ignore

* update changelog

* move scripts to root folder

* add bypass execution policy for powershell windows

---------

Co-authored-by: Radu <[email protected]>
  • Loading branch information
brianignacio5 and radurentea authored Dec 10, 2024
1 parent d6e300f commit 02e0850
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 98 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ espressif_icon.png
get_serial_list.py
.yarnrc
*.vsix

export.ps1
export.bat

#dirs
.vscode
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,44 @@

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

## [1.9.0](https://github.com/espressif/vscode-esp-idf-extension/releases/tag/v1.9.0)

### Bug Fixes

- [Update to latest Espressif icon](https://github.com/espressif/vscode-esp-idf-extension/pull/1294)
- [Use static monitor terminal instance](https://github.com/espressif/vscode-esp-idf-extension/pull/1289)
- [Update create from project examples UI UX](https://github.com/espressif/vscode-esp-idf-extension/pull/1278)
- [Fix display of monitor the device when flash fails](https://github.com/espressif/vscode-esp-idf-extension/pull/1286)
- [Update recommended cp command](https://github.com/espressif/vscode-esp-idf-extension/pull/1269)
- [Enhance telemetry reporting](https://github.com/espressif/vscode-esp-idf-extension/pull/1272)
- [Make readme easy to follow](https://github.com/espressif/vscode-esp-idf-extension/pull/1295)
- [Fix for pwsh users](https://github.com/espressif/vscode-esp-idf-extension/pull/1279)
- [Fix PR comment remove build flash telemetry](https://github.com/espressif/vscode-esp-idf-extension/pull/1328)
- [Fix duplicate output; Add notification for success](https://github.com/espressif/vscode-esp-idf-extension/pull/1290)
- [Add validation for debug session status for monitor start with no reset flag](https://github.com/espressif/vscode-esp-idf-extension/pull/1270)
- [Update dockerfile, add qemu executable options](https://github.com/espressif/vscode-esp-idf-extension/pull/1282)
- [Add IDF_PATH and IDF_TOOLS_PATH to newly created project settings](https://github.com/espressif/vscode-esp-idf-extension/pull/1332)
- [Fix unit tests not being refreshed](https://github.com/espressif/vscode-esp-idf-extension/pull/1338)
- [Remove old documentation and update links](https://github.com/espressif/vscode-esp-idf-extension/pull/1342)
- [walkthrough bugfixes](https://github.com/espressif/vscode-esp-idf-extension/pull/1354)
- [Use only major minor version in espidf constraint file](https://github.com/espressif/vscode-esp-idf-extension/pull/1360)

### Features and enhancements

- [Add Espressif documentation](https://github.com/espressif/vscode-esp-idf-extension/pull/1291)
- [Filter serial devices by default and allow user to disable chip id in serial port list](https://github.com/espressif/vscode-esp-idf-extension/pull/1276)
- [Compute Python path from IDF_TOOLS_PATH and IDF_PATH](https://github.com/espressif/vscode-esp-idf-extension/pull/1263)
- [Enable/Disable status bar icons in Commands Tree view](https://github.com/espressif/vscode-esp-idf-extension/pull/1314)
- [Hoist linker (ld) errors to VS Code 'Problems' window](https://github.com/espressif/vscode-esp-idf-extension/pull/1317) Thanks @GillesZunino !
- [Support for multiple sdkconfig file in Project configuration editor](https://github.com/espressif/vscode-esp-idf-extension/pull/1252)
- [Disable cmds for Codespaces and redirect Flash monitor to Web extension](https://github.com/espressif/vscode-esp-idf-extension/pull/1297)
- [Support new IDF Size json format](https://github.com/espressif/vscode-esp-idf-extension/pull/1330)
- [Add check for missing compile_commands json](https://github.com/espressif/vscode-esp-idf-extension/pull/1271)
- [Enhance flash encryption with eFuse validation and more user information](https://github.com/espressif/vscode-esp-idf-extension/pull/1247)
- [Use idf_tools py export to get env variables](https://github.com/espressif/vscode-esp-idf-extension/pull/1343)
- [Add chinese translation for readme](https://github.com/espressif/vscode-esp-idf-extension/pull/1335)
- [Add extension walkthrough](https://github.com/espressif/vscode-esp-idf-extension/pull/1298)

## [1.8.1](https://github.com/espressif/vscode-esp-idf-extension/releases/tag/v1.8.1)

### Bug Fixes
Expand Down
7 changes: 7 additions & 0 deletions export.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DOSKEY idf.py=python.exe "%IDF_PATH%\tools\idf.py" $*
DOSKEY esptool.py=python.exe "%IDF_PATH%\components\esptool_py\esptool\esptool.py" $*
DOSKEY espefuse.py=python.exe "%IDF_PATH%\components\esptool_py\esptool\espefuse.py" $*
DOSKEY espsecure.py=python.exe "%IDF_PATH%\components\esptool_py\esptool\espsecure.py" $*
DOSKEY otatool.py=python.exe "%IDF_PATH%\components\app_update\otatool.py" $*
DOSKEY parttool.py=python.exe "%IDF_PATH%\components\partition_table\parttool.py" $*
cls
33 changes: 33 additions & 0 deletions export.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Define the Invoke-idfpy function
function global:Invoke-idfpy {
& python.exe `
"$($env:IDF_PATH)\tools\idf.py" @args
}

function global:esptool.py {
& python.exe `
"$($env:IDF_PATH)\components\esptool_py\esptool\esptool.py" @args
}

function global:espefuse.py {
& python.exe `
"$($env:IDF_PATH)\components\esptool_py\esptool\espefuse.py" @args
}

function global:espsecure.py {
& python.exe `
"$($env:IDF_PATH)\components\esptool_py\esptool\espsecure.py" @args
}

function global:otatool.py {
& python.exe `
"$($env:IDF_PATH)\components\app_update\otatool.py" @args
}

function global:parttool.py {
& python.exe `
"$($env:IDF_PATH)\components\partition_table\parttool.py" @args
}

# Create an alias for the function
New-Alias -Name idf.py -Value Invoke-idfpy -Force -Scope Global
156 changes: 75 additions & 81 deletions src/checkExtensionSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,29 @@
* limitations under the License.
*/
import * as vscode from "vscode";
import {
getSetupInitialValues,
isCurrentInstallValid,
} from "./setup/setupInit";
import { isCurrentInstallValid } from "./setup/setupInit";
import { Logger } from "./logger/logger";
import { NotificationMode, readParameter } from "./idfConfiguration";
import { useIdfSetupSettings } from "./setup/setupValidation/espIdfSetup";
import { readParameter } from "./idfConfiguration";
import {
checkIdfSetup,
useIdfSetupSettings,
} from "./setup/setupValidation/espIdfSetup";
import { getIdfMd5sum } from "./setup/espIdfJson";
import { getEspIdfFromCMake } from "./utils";
import { IdfSetup } from "./views/setup/types";

export async function checkExtensionSettings(
extensionPath: string,
workspace: vscode.Uri,
espIdfStatusBar: vscode.StatusBarItem
) {
const showSetupWindow = readParameter("idf.showOnboardingOnInit") as boolean;
if (!showSetupWindow) {
return;
}
const showWelcomePage = readParameter(
"idf.showOnboardingOnInit",
workspace
) as boolean;
try {
const isExtensionConfigured = await isCurrentInstallValid(workspace);
if (isExtensionConfigured) {
await vscode.commands.executeCommand("espIdf.welcome.start");
if (showWelcomePage && isExtensionConfigured) {
vscode.commands.executeCommand("espIdf.welcome.start");
return;
}
} catch (error) {
Expand All @@ -45,73 +47,65 @@ export async function checkExtensionSettings(
: "Checking if current install is valid throws an error.";
Logger.error(msg, error, "checkExtensionSettings");
}
const notificationMode = readParameter(
"idf.notificationMode",
workspace
) as string;
const ProgressLocation =
notificationMode === NotificationMode.All ||
notificationMode === NotificationMode.Notifications
? vscode.ProgressLocation.Notification
: vscode.ProgressLocation.Window;
await vscode.window.withProgress(
{
cancellable: false,
location: ProgressLocation,
title: "ESP-IDF: Loading initial configuration...",
},
async (
progress: vscode.Progress<{ message: string; increment: number }>,
cancelToken: vscode.CancellationToken
) => {
try {
const setupArgs = await getSetupInitialValues(
extensionPath,
progress,
workspace
);
setupArgs.espIdfStatusBar = espIdfStatusBar;
if (setupArgs.existingIdfSetups && setupArgs.existingIdfSetups.length) {
progress.report({
increment: 5,
message: "ESP-IDF and tools found, configuring the extension...",
});
const confTarget = readParameter(
"idf.saveScope"
) as vscode.ConfigurationTarget;
const options = setupArgs.existingIdfSetups.map((existingSetup) => {
return {
label: `ESP-IDF ${existingSetup.version} in ${existingSetup.idfPath}`,
target: existingSetup,
};
});
const selectedSetup = await vscode.window.showQuickPick(options, {
placeHolder: "Select a ESP-IDF setup to use",
});
if (!selectedSetup) {
return;
}
await useIdfSetupSettings(
selectedSetup.target,
confTarget,
workspace,
espIdfStatusBar
);
} else if (
typeof process.env.WEB_IDE === "undefined" &&
showSetupWindow
) {
vscode.commands.executeCommand("espIdf.setup.start", setupArgs);
}
} catch (error) {
const msg = error.message
? error.message
: "Error loading initial configuration.";
Logger.errorNotify(msg, error, "checkExtensionSettings");
if (showSetupWindow) {
vscode.commands.executeCommand("espIdf.setup.start");
}
}
}

if (!showWelcomePage) {
return;
}

const actionItems = [
"Open Setup wizard",
"Choose from existing ESP-IDF setups.",
];

if (vscode.env.remoteName === "dev-container") {
actionItems.unshift("Use docker container configuration");
}

const action = await vscode.window.showInformationMessage(
"The extension configuration is not valid. Choose an action:",
...actionItems
);
if (!action) {
return;
}

if (action === "Use docker container configuration") {
const idfPath = "/opt/esp/idf";
const idfToolsPath = "/opt/esp";
const gitPath = "/usr/bin/git";
const idfSetupId = getIdfMd5sum(idfPath);
const idfVersion = await getEspIdfFromCMake(idfPath);
const containerIdfSetup: IdfSetup = {
id: idfSetupId,
idfPath,
gitPath,
toolsPath: idfToolsPath,
version: idfVersion,
isValid: false,
};
containerIdfSetup.isValid = await checkIdfSetup(containerIdfSetup);

if (!containerIdfSetup.isValid) {
vscode.window.showInformationMessage(
"The docker container configuration is not valid"
);
return;
}

await useIdfSetupSettings(
containerIdfSetup,
vscode.ConfigurationTarget.WorkspaceFolder,
workspace,
espIdfStatusBar
);
return;
}

if (action === "Open Setup wizard") {
vscode.commands.executeCommand("espIdf.setup.start");
return;
} else if (action === "Choose from existing ESP-IDF setups.") {
vscode.commands.executeCommand("espIdf.selectCurrentIdfVersion");
return;
}
}
3 changes: 2 additions & 1 deletion src/cmdTreeView/cmdStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export interface IDFCommandDescription {

export enum IDFWebCommandKeys {
Flash = "espIdfWeb.flash",
Monitor = "espIdfWeb.monitor"
Monitor = "espIdfWeb.monitor",
FlashAndMonitor = "espIdfWeb.flashAndMonitor"
}

export enum CommandKeys {
Expand Down
40 changes: 31 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,9 @@ export async function activate(context: vscode.ExtensionContext) {
});
});

registerIDFCommand("espIdf.createIdfTerminal", createIdfTerminal);
registerIDFCommand("espIdf.createIdfTerminal", () =>
createIdfTerminal(context.extensionPath)
);
registerIDFCommand("espIdf.jtag_flash", () =>
flash(false, ESP.FlashType.JTAG)
);
Expand Down Expand Up @@ -3630,11 +3632,7 @@ export async function activate(context: vscode.ExtensionContext) {
Logger.warn(`Failed to handle URI Open, ${uri.toString()}`);
},
});
await checkExtensionSettings(
context.extensionPath,
workspaceRoot,
statusBarItems["currentIdfVersion"]
);
checkExtensionSettings(workspaceRoot, statusBarItems["currentIdfVersion"]);

// WALK-THROUGH
let disposable = vscode.commands.registerCommand(
Expand Down Expand Up @@ -4082,7 +4080,7 @@ function createQemuMonitor() {
}

const buildFlashAndMonitor = async (runMonitor: boolean = true) => {
PreCheck.perform([webIdeCheck, openFolderCheck], async () => {
PreCheck.perform([openFolderCheck], async () => {
const notificationMode = idfConf.readParameter(
"idf.notificationMode",
workspaceRoot
Expand Down Expand Up @@ -4113,6 +4111,11 @@ const buildFlashAndMonitor = async (runMonitor: boolean = true) => {
if (!canContinue) {
return;
}
// Re route to ESP-IDF Web extension if using Codespaces or Browser
if (vscode.env.uiKind === vscode.UIKind.Web) {
vscode.commands.executeCommand(IDFWebCommandKeys.FlashAndMonitor);
return;
}
progress.report({
message: "Flashing project into device...",
increment: 60,
Expand Down Expand Up @@ -4260,17 +4263,36 @@ async function startFlashing(
}
}

function createIdfTerminal() {
function createIdfTerminal(extensionPath: string) {
PreCheck.perform([openFolderCheck], async () => {
const modifiedEnv = await utils.appendIdfAndToolsToPath(workspaceRoot);
let shellArgs = [];
if (process.platform === "win32") {
if (
vscode.env.shell.indexOf("powershell") !== -1 ||
vscode.env.shell.indexOf("pwsh") !== -1
) {
shellArgs = ["-ExecutionPolicy", "Bypass", "-NoProfile"];
}
}
const espIdfTerminal = vscode.window.createTerminal({
name: "ESP-IDF Terminal",
env: modifiedEnv,
cwd: workspaceRoot.fsPath || modifiedEnv.IDF_PATH || process.cwd(),
strictEnv: true,
shellArgs: [],
shellArgs,
shellPath: vscode.env.shell,
});
if (process.platform === "win32") {
if (vscode.env.shell.indexOf("cmd.exe") !== -1) {
espIdfTerminal.sendText(path.join(extensionPath, "export.bat"));
} else if (
vscode.env.shell.indexOf("powershell") !== -1 ||
vscode.env.shell.indexOf("pwsh") !== -1
) {
espIdfTerminal.sendText(path.join(extensionPath, "export.ps1"));
}
}
espIdfTerminal.show();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui-test/configure-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("Configure extension", () => {

before(async function () {
this.timeout(100000);
await new Promise((res) => setTimeout(res, 2000));
await new Promise((res) => setTimeout(res, 10000));
const notifications = await new Workbench().getNotifications();
for (let n of notifications) {
await n.dismiss();
Expand Down
Loading

0 comments on commit 02e0850

Please sign in to comment.