Skip to content

Conversation

@radurentea
Copy link
Collaborator

Description

This enhancement:

  • adds hints for openOCD errors (manual searching using esp-idf hints viewer, search error command)
  • improves matching for building errors based on automatic/manual searches
  • adds notification system that will show the user 2 actions when it comes to hints related to building the project
    - Focus on the ESP-IDF hints bottom panel
    - Mutes "Found Hint" notification for this VS Code session (until VS Code is closed)
  • adds real-time hints display for openocd errors (when running OpenOCD session, if an error appears and a hint is found for that error, Hints Viewer bottom panel will be focused)
  • improves hover over errors in text editor (building errors) by increasing the display of the hints when hovering over the entire line where error was found. In the old version, the squiggly line had the length of 1 character. If there were other errors in the same line, for example from C/C++ Extension, it would require luck to find the portion for the ESP-IDF hint to be shown.
  • Adds extra child for hints in the tree structured data which is clickable (will open the link address in default browser), in case the hint has a link property

Type of change

  • New feature (non-breaking change which adds functionality)

Steps to test this pull request

  1. Manual searching for errors related to OpenOCD (OpenOCD version needs to be >= v0.12.0-esp32-20250226). List of error-hints pair is taken from:
    <ESP_TOOLS_INSTALLATION_PATH>/tools/openocd-esp32/<OPEN_OCD_VERSION>/openocd-esp32/share/openocd/espressif/tools/esp_problems_hints.yml
  2. Manual searching for errors that come from esp-idf's hints yml file, located at <ESP_IDF_INSTALLATION_PATH>/<ESP_IDF_VERSION>/esp-idf/tools/idf_py_actions/hints.yml
  3. Try to reproduce errors from inside both yaml files (esp-idf, openocd) and see if the hints are triggered automatically. The errors from esp-idf should display a notification with 2 actions, while the openocd hints should automatically trigger focus on hints viewer bottom panel
  4. When having errors inside the text editor, post build (for example: adding #include "spiram.h" inside the main.c file of an esp-idf example project), make sure hint is displayed when hovering over the line that has the squiggly lined text

How has this been tested?

As described above

Test Configuration:

  • ESP-IDF Version: master
  • OS (Windows,Linux and macOS): macOS

Checklist

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

@github-actions
Copy link

github-actions bot commented Mar 14, 2025

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

@radurentea radurentea self-assigned this Mar 14, 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.

Some code suggestions to simplify functionality.

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

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 Apr 9, 2025
@github-actions github-actions bot closed this Apr 14, 2025
@radurentea radurentea added ongoing Ongoing Issue or PR, this label will be used for issue or PR which is to be excluded by stale bot and removed stale Stale PR or Issue labels Apr 15, 2025
@radurentea radurentea reopened this Apr 15, 2025
@brianignacio5 brianignacio5 requested a review from Fabricio-ESP May 7, 2025 08:32
@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from 675b284 to 65efe87 Compare May 7, 2025 14:07
@radurentea radurentea requested a review from brianignacio5 May 7, 2025 14:08
@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from f3793f8 to 57799e8 Compare May 9, 2025 08:53
@radurentea radurentea added this to the v1.11.0 milestone May 19, 2025
@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from 57799e8 to 10c0173 Compare July 3, 2025 04:37
@radurentea radurentea removed the ongoing Ongoing Issue or PR, this label will be used for issue or PR which is to be excluded by stale bot label Jul 3, 2025
src/extension.ts Outdated
);
};
// Store display hints notification (until VS Code is closed)
context.workspaceState.update("idf.showHintsNotification", true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this state necessary? I don't see being disabled on extension deactivation. Maybe is not necessary ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The idea behind it was to have a reset of the hints viewer's notifications for each session. I don't remember why I went with this implementation of the Notification System for Hints Viewer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've pushed a new commit in which I converted idf.showHintsNotification from runtime workspace state to proper configurable setting that will persist in workspace settings

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 without using the workspaceState setting, which doesn't seem to be configurable.

@radurentea radurentea requested a review from brianignacio5 July 3, 2025 13:26
@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from bcbd569 to 33c0402 Compare July 3, 2025 13:29
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.

Missing translation and documentation of new setting.

@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from d8d4fe9 to 8f4b8bc Compare July 11, 2025 07:46
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.

Confirmed working.
Thanks for the change on how the hints are displayed.

@Fabricio-ESP Fabricio-ESP changed the title Enhance/hints viewer openocd [VSC-1541] Enhance/hints viewer openocd Jul 22, 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.

Please review existing status bar items implementation and use of registerIDFCommand instead of vscode.commands.registerCommand

@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from 997eb9c to 8501057 Compare July 30, 2025 08:08
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 with minor change regarding code organization.

- Refactor code
- Add Translations
- fix errors related to errorHints view
- change === to includes
- remove checking for openOCD hints, hints from openocd will not be present in text editor
Before this fix, if there were multiple hints matches, there would be multiple notifications
Convert idf.showHintsNotification from runtime workspace state to proper configurable setting
Added validation for checking if any workspace is open
- Add translations for new hints viewer status bar item implementation
- Remove translation from old notification system for hints viewer
- Clean some unnecessary comments
- Move hints status bar creation to createCmdsStatusBarItems function
- Change id from "idfErrorHints" to "espIdf.errorHints"
- Use "registerIDFCommand" instead of "vscode.commands.registerCommand"
@radurentea radurentea force-pushed the enhance/hints-viewer-openocd branch from 8501057 to 364a879 Compare August 4, 2025 07:56
@radurentea radurentea merged commit 1bd4dbe into master Aug 18, 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.

4 participants