feat: Bundle CDT-LSP plugins with Espressif-IDE#877
Conversation
WalkthroughThe recent changes involve enhancing toolchain management, project configuration, and language server support within the Espressif IDF project. Changes
Related issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (1)
- releng/com.espressif.idf.update/category.xml
Files selected for processing (1)
- releng/com.espressif.idf.product/idf.product (1 hunks)
Files skipped from review due to trivial changes (1)
- releng/com.espressif.idf.product/idf.product
There was a problem hiding this comment.
I think we need to change a lot of our classpath files to have Java 17 you can see the warnings when building.
We can have a separate ticket for this
alirana01
left a comment
There was a problem hiding this comment.
Looks very good. A solid effort indeed. Can we please try to add the code formatter for the new project as well.
82c2272 to
14f661a
Compare
This will enable the user to install the all the required features in one go!
com.espressif.idf.lsp plugin contributes idf specific changes to espressif-ide
14f661a to
a182337
Compare
|
@kolipakakondal hi! Tested under: |
|
@kolipakakondal hi ! Windows 10 open workspace -> go to "Preferences" - "Editor LSP" (clangd) -> empty Clangd Path Now install tools -> go to "Preferences" - "Editor LSP" (clangd) -> Path hasn't been updated. Eclipse Restart fix issue. |
fixed |
@kolipakakondal the issue is still persist. For example, if user does not have tools in .espressif folder installed - then is still shows empty PATH even after installation. Please, delete .espressif folder and follow steps: open workspace -> go to "Preferences" - "Editor LSP" (clangd) -> empty Clangd Path -> Now install tools -> go to "Preferences" - "Editor LSP" (clangd) -> Still Empty PATH |
Invalid arch name 'rv32imac_zicsr_zifencei', unsupported standard user-level extension 'zicsr'
0de946c to
e98e726
Compare
There was a problem hiding this comment.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (6)
bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdEnable.xmlis excluded by:!**/*.xmlbundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xmlis excluded by:!**/*.xmlbundles/com.espressif.idf.lsp/pom.xmlis excluded by:!**/*.xmlbundles/pom.xmlis excluded by:!**/*.xmlfeatures/com.espressif.idf.feature/feature.xmlis excluded by:!**/*.xmlreleng/com.espressif.idf.update/category.xmlis excluded by:!**/*.xml
Files selected for processing (18)
- bundles/com.espressif.idf.core/META-INF/MANIFEST.MF (1 hunks)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (1 hunks)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (1 hunks)
- bundles/com.espressif.idf.lsp/.classpath (1 hunks)
- bundles/com.espressif.idf.lsp/.gitignore (1 hunks)
- bundles/com.espressif.idf.lsp/.project (1 hunks)
- bundles/com.espressif.idf.lsp/.settings/org.eclipse.core.resources.prefs (1 hunks)
- bundles/com.espressif.idf.lsp/.settings/org.eclipse.jdt.core.prefs (1 hunks)
- bundles/com.espressif.idf.lsp/META-INF/MANIFEST.MF (1 hunks)
- bundles/com.espressif.idf.lsp/build.properties (1 hunks)
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/ClangdConfigFileHandler.java (1 hunks)
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/ILSPConstants.java (1 hunks)
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdEnable.java (1 hunks)
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (1 hunks)
- bundles/com.espressif.idf.ui/META-INF/MANIFEST.MF (1 hunks)
- bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (4 hunks)
- releng/com.espressif.idf.product/idf.product (1 hunks)
- releng/com.espressif.idf.target/com.espressif.idf.target.target (2 hunks)
Files skipped from review due to trivial changes (5)
- bundles/com.espressif.idf.lsp/.classpath
- bundles/com.espressif.idf.lsp/.gitignore
- bundles/com.espressif.idf.lsp/.settings/org.eclipse.core.resources.prefs
- bundles/com.espressif.idf.lsp/build.properties
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/ILSPConstants.java
Additional comments: 16
bundles/com.espressif.idf.lsp/.settings/org.eclipse.jdt.core.prefs (2)
- 2-9: The configuration to use Java 17 as the target platform, compliance level, and source level is appropriate, considering Java 17 is an LTS version. This ensures stability and compatibility for the project.
- 4-7: Configuring compiler problem settings to treat assert and enum identifiers as errors, and disabling preview features, aligns with best practices for maintaining code quality and stability in a Java project.
bundles/com.espressif.idf.lsp/.project (1)
- 1-32: The project configuration, including the project name, build commands, and project natures, is correctly set up for an Eclipse plugin project. This ensures proper building and packaging of the plugin.
bundles/com.espressif.idf.lsp/META-INF/MANIFEST.MF (1)
- 1-17: The bundle metadata, including the version increment and required bundles, is correctly defined. This ensures the plugin has the necessary dependencies and is versioned appropriately for future updates.
bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdEnable.java (1)
- 22-37: The implementation of
isEnabledFormethod correctly checks for the IDF project nature before enabling the language server, with proper exception handling and logging. This ensures that the language server is only enabled for relevant projects.bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (1)
- 26-42: The implementation of
clangdPathandqueryDrivermethods correctly determines the paths usingIDFUtiland handles potential null values gracefully withOptional.ofNullable. Proper logging is also implemented, enhancing debuggability.bundles/com.espressif.idf.ui/META-INF/MANIFEST.MF (1)
- 46-49: The addition of
org.eclipse.cdt.lsp,org.eclipse.cdt.lsp.clangd, andcom.espressif.idf.lspto theRequire-Bundlesection is appropriate for integrating LSP support into the IDE, aligning with the PR's objectives.bundles/com.espressif.idf.core/META-INF/MANIFEST.MF (1)
- 46-48: The addition of
org.yaml.snakeyaml,org.yaml.snakeyaml.parser, andorg.yaml.snakeyaml.utilto theExport-Packagesection is appropriate for supporting YAML parsing and generation, which may be necessary for project configuration or other purposes.bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/ClangdConfigFileHandler.java (1)
- 27-57: The implementation of the
updatemethod for modifying.clangdconfiguration files is correctly done, with proper handling of YAML data and logging of errors. However, it's recommended to handleFileNotFoundExceptionmore gracefully, potentially by creating the file if it doesn't exist or notifying the user.releng/com.espressif.idf.product/idf.product (1)
- 78-78: The addition of
org.eclipse.cdt.lsp.featureto the product configuration aligns with the PR's objective to enhance IDE functionality by integrating CDT LSP support. Ensure that the integration of this feature with the rest of the IDE components is thoroughly tested.bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (2)
- 8-8: The addition of the import statement for
FileNotFoundExceptionis necessary for the new methodupdateClangdFileto handle exceptions properly.- 144-151: The method
updateClangdFileproperly updates the Clangd configuration file for new projects, aligning with the PR's objectives. Consider adding error handling for other potential exceptions that might occur during file operations.releng/com.espressif.idf.target/com.espressif.idf.target.target (2)
- 79-83: The addition of new units like
org.apache.batik.css,org.apache.batik.util, etc., supports new functionalities or dependencies required by the plugin. Ensure their integration and compatibility with the rest of the plugin are thoroughly tested.- 83-83: The update to the repository location for some dependencies aims to use the latest or more appropriate versions. Verify the compatibility of the updated dependencies with the plugin to ensure no issues are introduced.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (1)
- 155-161: The method
findCompilerefficiently finds a compiler for a given target name, aligning with the PR's objectives to enhance toolchain management. Consider adding documentation to clarify the expected format of the target name and the behavior when no compiler is found.bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (1)
- 341-354: The newly added method
getXtensaToolchainExePathForActiveTarget()lacks error handling and documentation. Consider adding Javadoc comments to explain the method's purpose, parameters, and return value. Additionally, think about how to handle cases where the target or compiler file is not found more gracefully, perhaps by logging a warning or throwing a specific exception to aid in debugging and error tracking.
There was a problem hiding this comment.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
bundles/com.espressif.idf.lsp/plugin.xmlis excluded by:!**/*.xml
Files selected for processing (3)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (2 hunks)
- bundles/com.espressif.idf.lsp/build.properties (1 hunks)
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java
- bundles/com.espressif.idf.lsp/build.properties
- bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java
* feat: Add CDT-LSP Preview plugins with IEP plugin * feat: Bundle lsp feature in espressif-ide * feat: Add com.espressif.idf.lsp plugin * fix: auto-detect clangd from the PATH and set in preferences * fix: editor color code issues * fix: Avoid errors with riscv toolchains







This PR enable the following.
Description
Please include a summary of the change and which issue is fixed.
https://jira.espressif.com:8443/browse/IEP-1117
https://jira.espressif.com:8443/browse/IEP-1149
Type of change
How has this been tested?
https://github.com/espressif/idf-eclipse-plugin/blob/master/docs/clangd_cdt_support.md
Test Configuration:
Dependent components impacted by this PR:
Checklist
Summary by CodeRabbit
New Features
.clangdconfiguration files in IDF projects, enabling better integration with Language Server Protocol (LSP).Documentation
Chores