-
Notifications
You must be signed in to change notification settings - Fork 4
EIM-123 Added minimal tools selection implelmentation #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Hahihula, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a comprehensive tool selection feature for the ESP-IDF installation wizard. It provides both command-line and graphical user interface options for users to specify which development tools they wish to install alongside their chosen ESP-IDF versions. This enhancement aims to give users more control over their installation environment, allowing for more tailored and efficient setups. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new feature for selecting which tools to install with ESP-IDF, both in the CLI wizard and the GUI. The implementation is quite comprehensive, covering backend logic in Rust and a new UI component in Vue.
Overall, the changes are well-structured. I've left a few comments with suggestions for minor improvements, such as removing redundant code, simplifying some logic for better readability and performance, and refactoring a Vue component to reduce duplication.
Please also note the typo in the PR title ('implelmentation').
| use idf_im_lib::tool_selection::{ | ||
| fetch_tools_file, get_tools_for_selection, get_tools_json_url, | ||
| select_tools_interactive, select_tools_non_interactive, | ||
| get_required_tools, ToolSelectionInfo, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src-tauri/src/cli/prompts.rs
Outdated
| } | ||
| }; | ||
|
|
||
| let targets = settings.target.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The targets variable is cloned here, but it's only used immutably within the loop. To avoid an unnecessary allocation, you can remove this line and use settings.target directly inside the loop when calling get_tools_for_selection.
On line 561, you would change targets.as_ref().map(|t| t.as_slice()) to settings.target.as_ref().map(|t| t.as_slice()).
| config.repo_stub.clone().as_deref(), | ||
| &idf_version.to_string(), | ||
| config.idf_mirror.clone().as_deref() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .clone() calls on config.repo_stub and config.idf_mirror are redundant. as_deref() can operate on &Option<String> directly. You can remove the clones for better performance and cleaner code.
| config.repo_stub.clone().as_deref(), | |
| &idf_version.to_string(), | |
| config.idf_mirror.clone().as_deref() | |
| config.repo_stub.as_deref(), | |
| &idf_version.to_string(), | |
| config.idf_mirror.as_deref() |
| if config.idf_tools_per_version.is_none() { | ||
| config.idf_tools_per_version = Some(HashMap::new()); | ||
| } | ||
| if let Some(ref mut per_version) = config.idf_tools_per_version { | ||
| per_version.insert( | ||
| idf_version.clone(), | ||
| get_tool_names(&selected_tools), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| // Assuming these helper functions exist in your codebase | ||
| // use crate::helpers::{get_settings_non_blocking, update_settings, send_message}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| settings.repo_stub.clone().as_deref(), | ||
| &version, | ||
| settings.idf_mirror.clone().as_deref() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .clone() calls on settings.repo_stub and settings.idf_mirror are redundant. as_deref() can operate on &Option<String> directly, so you can remove the clones for slightly better performance and cleaner code.
| settings.repo_stub.clone().as_deref(), | |
| &version, | |
| settings.idf_mirror.clone().as_deref() | |
| settings.repo_stub.as_deref(), | |
| &version, | |
| settings.idf_mirror.as_deref() |
ef8adcc to
1b42339
Compare
1b42339 to
d3f6cb0
Compare
forced esp-clang to be required tool
d3f6cb0 to
2ac0d3f
Compare

Uh oh!
There was an error while loading. Please reload this page.