Skip to content

Conversation

@ClSlaid
Copy link
Contributor

@ClSlaid ClSlaid commented Aug 6, 2025

The original error message posting /tools/idf.py not found, meanwhile the extension don't search this directory, which is misleading.

This PR corrects those messages.


BTW, I ought to find out why this extension cannot detect my esp-idf installed with this ArchLinux AUR repo. The repo installs esp-idf to /opt/esp-idf, surely there is ./tools/idf.py or ./tools/export.sh.

Even I was sure of the existence of /opt/esp-idf/tools/idf.py, the extension still keeps yelling /tools/idf.py not found. Which I don't reproduce on the master branch. So it's assumed to be fixed and I'll just update the error message here.


Feel free to edit this PR, busy working recently.


Description

Please include a summary of the change and which issue is fixed.

Fixes... I hate summaries, here is what Copilot concludes:

This pull request improves the handling and reporting of ESP-IDF path validation in the setup flow. The main changes focus on more accurate error messaging and streamlining file access checks.

Error Messaging Improvements:

  • Updated error messages in both main.ts and store.ts to display the actual path checked for ESP-IDF validity, making it clearer to users which path is problematic. [1] [2]

File Access Check Logic:

  • Refactored the logic in SetupPanel.ts to ensure the file access check only proceeds when a path is provided, and to consistently use the full path to tools/idf.py in responses. This prevents unnecessary checks and improves accuracy in reporting. [1] [2]

Code Formatting:

  • Minor formatting adjustment to the error message construction in SetupPanel.ts for consistency.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Steps to test this pull request

Provide a list of steps to test changes in this PR and required output

  1. Click on "Command"
  2. Execute action.
  3. Observe results.
  • Expected behaviour:

  • Expected output:

How has this been tested?

Just opened configure extension, select existing toolchains, and type in an incorrect ESP-IDF's path like /booger/aids to see if it reminds path /booger/aids/tools/idf.py not found.

Dependent components impacted by this PR:

None.

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

The original error message posting `/tools/idf.py` not found,
meanwhile the extension don't search this directory, which is
misleading.

This PR corrects those messages.

---

BTW, I was ought to find out why this extension cannot detect my
esp-idf installed with this
[ArchLinux AUR repo](https://aur.archlinux.org/packages/esp-idf-git).
The repo installs esp-idf to `/opt/esp-idf`, surely there is
`./tools/idf.py` or `./tools/export.sh`.

Even I was sure the
existense of `/opt/esp-idf/tools/idf.py`, the extension still keeps
yelling `/tools/idf.py` not found. Which I don't reproduce on the
master branch. So it's assumed to be fixed and I'll just update your
error message here.

Signed-off-by: 蔡略 <[email protected]>
Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kolipakakondal kolipakakondal requested a review from Copilot August 7, 2025 08:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR corrects misleading error messages in the ESP-IDF setup flow by updating error messages to display the actual path being checked for validation instead of a generic "/tools/idf.py" message.

  • Updates error messages in setup store and main to show the specific path that failed validation
  • Refactors file access check logic to ensure proper path handling and prevent unnecessary checks
  • Improves accuracy in error reporting by displaying the full path to tools/idf.py in responses

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/views/setup/store.ts Updates error message to display the actual path checked instead of hardcoded "/tools/idf.py"
src/views/setup/main.ts Updates error message to use the specific path from the response message
src/setup/SetupPanel.ts Refactors file access check logic and ensures consistent path reporting in responses

@github-actions
Copy link

Pull request has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

@github-actions github-actions bot added the stale Stale PR or Issue label Aug 23, 2025
@ClSlaid ClSlaid requested a review from brianignacio5 August 25, 2025 07:35
@ClSlaid
Copy link
Contributor Author

ClSlaid commented Aug 25, 2025

/cc @brianignacio5 merge it if you feel this PR is fine.

@github-actions github-actions bot changed the title [chore][setup]: misleading idf.py not found error [chore][setup]: misleading idf.py not found error (VSC-1761) Aug 25, 2025
@github-actions github-actions bot removed the stale Stale PR or Issue label Aug 26, 2025
Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update.

@brianignacio5 brianignacio5 added this to the v1.11.0 milestone Aug 29, 2025
@brianignacio5 brianignacio5 merged commit 88578fb into espressif:master Sep 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants