Skip to content

IEP-1067 Default config auto creation for debug#895

Merged
kolipakakondal merged 4 commits into
v2.13.0from
IEP-1067
Feb 15, 2024
Merged

IEP-1067 Default config auto creation for debug#895
kolipakakondal merged 4 commits into
v2.13.0from
IEP-1067

Conversation

@sigmaaa
Copy link
Copy Markdown
Collaborator

@sigmaaa sigmaaa commented Jan 31, 2024

Description

When a new project is created we automatically adding a debug config for this project now.

Fixes # (IEP-1067)

Type of change

Please delete options that are not relevant.

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

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

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

Dependent components impacted by this PR:

  • Component 1
  • Component 2

Checklist

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

Summary by CodeRabbit

  • New Features
    • Enhanced the project creation wizard to automatically create and save a new launch configuration for debugging.
    • Improved project generator initialization for more robust project setup.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 31, 2024

Warning

Rate Limit Exceeded

@sigmaaa has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 8 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between f9535db and c8f9cf5.

Walkthrough

This update introduces enhancements to the ESP-IDF (Espressif IoT Development Framework) project creation wizard in Eclipse. It incorporates additional imports to support new functionalities, including the automatic creation and saving of a launch configuration for debugging purposes right from the project setup phase. This streamlines the process for developers, making it easier to jump straight into debugging after project creation.

Changes

File Path Change Summary
.../idf/ui/wizard/NewIDFProjectWizard.java Added imports; performFinish now includes createDefaultDebugConfig; updated getGenerator method.

🐇✨
In the realm of code, where wizards dwell,
A magic spell, with a debug bell.
Projects spring to life, with ease so grand,
In Espressif's land, by a rabbit's hand.
🌟📚

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 79526b9 and dd1863c.
Files selected for processing (1)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (11 hunks)
Additional comments: 4
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (4)
  • 17-33: The addition of imports from org.eclipse.debug.core, org.eclipse.jface.dialogs, org.eclipse.jface.wizard, org.eclipse.launchbar.ui, and org.eclipse.swt.widgets indicates new dependencies on Eclipse's debugging, dialog, wizard, launchbar UI, and widget functionalities. Ensure these imports are used effectively within the file and that there are no unused imports to maintain code cleanliness.
  • 123-123: The call to createDefaultDebugConfig within the performFinish method is a significant addition. It's crucial to ensure that this method is called at the appropriate time in the project creation workflow and that it does not introduce any side effects or disrupt the normal flow of project creation. Additionally, verify that the TargetSwitchJob and its scheduling do not conflict with the creation of the default debug configuration.
  • 129-156: The createDefaultDebugConfig method introduces a new launch configuration wizard and dialog for debugging purposes. This method is well-structured, but consider the following:
  • Ensure that Display.getDefault().getActiveShell() is the appropriate context for launching the dialog. In some cases, it might be better to use a more specific shell related to the current wizard or workspace.
  • The exception handling within the try-catch block only logs the exception. Consider providing user feedback in case of failure, such as displaying an error message dialog.
  • Verify that the disposal of the wizard (wizard.dispose()) does not prematurely dispose of resources needed by other parts of the application or this wizard instance.

Overall, this method significantly enhances the debugging setup process by automating configuration creation. However, ensure that the user experience is smooth and that any potential errors are handled gracefully.

  • 170-171: The update to the IDFProjectGenerator initialization in the getGenerator method now includes an extra boolean argument. This change likely supports the new feature for creating default debug configurations. Ensure that this new argument (true) correctly represents the intended behavior throughout the project generation process and that it does not inadvertently affect other functionalities.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between dd1863c and ce5ba3d.
Files selected for processing (1)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (10 hunks)
Files skipped from review as they are similar to previous changes (1)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java

@sigmaaa sigmaaa changed the title WIP: IEP-1067 Default config auto creation for debug IEP-1067 Default config auto creation for debug Feb 1, 2024
@kolipakakondal kolipakakondal added this to the v2.13.0 milestone Feb 2, 2024
@AndriiFilippov
Copy link
Copy Markdown
Collaborator

@sigmaaa hi !

Tested under:
OS - Windows 10

Steps:

  1. can't delete Launch Configuration (technically it is deleted but still displayed in Launch Config box).

image

  1. can't rename Launch Configuration (same - technically it is renamed but still displayed in Launch Config box)
    image

@sigmaaa
Copy link
Copy Markdown
Collaborator Author

sigmaaa commented Feb 8, 2024

@sigmaaa hi !

Tested under: OS - Windows 10

Steps:

  1. can't delete Launch Configuration (technically it is deleted but still displayed in Launch Config box).

image

  1. can't rename Launch Configuration (same - technically it is renamed but still displayed in Launch Config box)
    image

Hi @AndriiFilippov, the default launch configuration can't be renamed or deleted. This behaviour is inherited from the eclipse cdt

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ce5ba3d and 761c7b3.
Files selected for processing (1)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3 hunks)
Files not reviewed due to errors (1)
  • IDFBuildConfiguration.java (no review received)

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8aa9b51 and f9535db.
Files selected for processing (2)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (6 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (10 hunks)
Files skipped from review as they are similar to previous changes (1)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java
Additional comments: 4
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (4)
  • 17-34: Ensure that all newly imported classes are used within the file. Unused imports can lead to unnecessary dependencies and clutter.
  • 60-60: The constant NEW_LAUNCH_CONFIG_EDIT_PAGE is well-named, following Java constant naming conventions.
  • 182-183: The modification in the getGenerator method to include a selected target as an argument in the IDFProjectGenerator constructor is logical and supports the new feature. Ensure that all calls to getGenerator have been updated accordingly.
  • 239-251: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [196-263]

The TargetSwitchJob class is a significant addition. Review the logic for finding and switching to a suitable target. Ensure that the synchronization with the UI thread (Display.getDefault().syncExec) does not introduce any performance issues or deadlocks. Additionally, validate the logic for finding a suitable target based on the selected target string.

@AndriiFilippov
Copy link
Copy Markdown
Collaborator

@sigmaaa hi !

Tested under:
OS - Windows 10
ESP-IDF: v5.1.2

able to build \ debug with default configurations 🟢
able to edit configs 🟢
able to create new configs 🟢
no issue after Eclipse restart \ exit 🟢

LGTM 👍

@kolipakakondal kolipakakondal changed the base branch from master to v2.13.0 February 15, 2024 08:13
Copy link
Copy Markdown
Collaborator

@kolipakakondal kolipakakondal 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 merged commit 122ccef into v2.13.0 Feb 15, 2024
@kolipakakondal kolipakakondal deleted the IEP-1067 branch February 15, 2024 08:17
kolipakakondal added a commit that referenced this pull request Feb 28, 2024
* fix: creating a default debug config together with project

* fix: setting launch configuration as default

Co-authored-by: Denys Almazov <almazovdenys@gmail.com>
AndriiFilippov pushed a commit that referenced this pull request Apr 22, 2024
* fix: creating a default debug config together with project

* fix: setting launch configuration as default

Co-authored-by: Denys Almazov <almazovdenys@gmail.com>
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