Skip to content
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

fix: Address issue with the cdt-lsp-2.0.0 #1021

Merged
merged 4 commits into from
Aug 12, 2024
Merged

fix: Address issue with the cdt-lsp-2.0.0 #1021

merged 4 commits into from
Aug 12, 2024

Conversation

kolipakakondal
Copy link
Collaborator

@kolipakakondal kolipakakondal commented Jul 19, 2024

Description

fix #1017

Fixes # (IEP-1291)

Fix the below problem and this appears while building a project with 3.0.0 release + Eclipse 2024-06

Screenshot 2024-08-09 at 5 00 00 AM

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Test Case 1:

  • Download Eclipse CDT 2026-06
  • Update with the PR build
  • Verify if you're able to see clangd preferences, and able to build the project and use clangd editor features

Test Case 2:

  • Download Espressif-IDE 3.0.0
  • Update with the PR build
  • Verify if you're able to see clangd preferences, and able to build the project and use clangd editor features

Test Configuration:

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

Dependent components impacted by this PR:

  • Editor
  • Clangd preferences

Checklist

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

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced configuration options for Clangd integration, allowing more tailored setups for users within the IDF environment.
    • Introduced new methods for improved functionality, including options for Tidy, background indexing, completion style, pretty printing, and additional options.
  • Bug Fixes

    • Updated behavior in the toolchain path handling to return an empty string when not found, improving user experience and reducing errors.
  • Chores

    • Updated dependency specifications, including changes to repository URLs and versions for certain units, ensuring compatibility with the latest features and fixes.

Copy link

coderabbitai bot commented Jul 19, 2024

Walkthrough

The recent updates to the IDFClangdOptionsDefaults class enhance Clangd options management within the IDF framework. By moving from subclassing to direct interface implementation, the class introduces new methods for better configurability, significantly improving user experience and ensuring compatibility with Eclipse updates.

Changes

Files Change Summary
bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java Shifted from extending BuiltinClangdOptionsDefaults to implementing ClangdOptionsDefaults. Modified queryDriver() and introduced new configuration methods.
releng/com.espressif.idf.target/com.espressif.idf.target.target Updated repository URLs and version specifications for several dependencies, ensuring compatibility with the latest Eclipse versions.

Assessment against linked issues

Objective Addressed Explanation
Eclipse update compatibility (IEP-1291)
Proper handling of Clangd options (IEP-1291)

Poem

In the garden of code where the rabbits play,
Clangd options bloom, brightening the day.
With tweaks and turns, our paths now align,
Eclipse updates shine, the code's so divine!
Hops of joy echo, as bugs drift away,
In our IDE meadow, let’s frolic and sway! 🐇✨


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 testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Collaborator

@sigmaaa sigmaaa 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

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 43dbad9 and b259a60.

Files selected for processing (1)
  • bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (2 hunks)
Additional comments not posted (7)
bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (7)

26-31: LGTM!

The clangdPath method correctly retrieves and logs the clangd executable path, returning a default value if not found.


33-39: LGTM!

The queryDriver method correctly retrieves and logs the toolchain executable path, returning an empty string if not found.


42-44: LGTM!

The useTidy method correctly returns a fixed value indicating whether to use Tidy.


47-49: LGTM!

The useBackgroundIndex method correctly returns a fixed value indicating whether to use Background Index.


52-54: LGTM!

The completionStyle method correctly returns a fixed value indicating the completion style.


57-59: LGTM!

The prettyPrint method correctly returns a fixed value indicating whether to use Pretty Print.


62-63: LGTM!

The additionalOptions method correctly returns an empty list of additional options.

Copy link

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b259a60 and 55e3122.

Files selected for processing (1)
  • bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (3 hunks)
Additional comments not posted (7)
bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (7)

Line range hint 26-32:
LGTM!

The clangdPath method is correctly implemented with appropriate logging and fallback mechanisms.


36-42: LGTM!

The queryDriver method is correctly implemented with appropriate logging and fallback mechanisms.


44-48: LGTM!

The useTidy method is straightforward and correctly implemented.


50-54: LGTM!

The useBackgroundIndex method is straightforward and correctly implemented.


56-60: LGTM!

The completionStyle method is straightforward and correctly implemented.


62-66: LGTM!

The prettyPrint method is straightforward and correctly implemented.


68-72: LGTM!

The additionalOptions method is straightforward and correctly implemented.

Copy link

@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.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
releng/com.espressif.idf.target/com.espressif.idf.target.target (1)

93-93: The version 0.0.0 for org.yaml.snakeyaml does not appear to be valid.

Both the Maven Central Repository and the GitHub repository for snakeyaml do not list this version. Please verify and correct the version if necessary.

Analysis chain

Verify the unit version for org.yaml.snakeyaml.

The version has been changed to 0.0.0. Ensure that this version is correct and intentional.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the version for `org.yaml.snakeyaml`.

# Test: Check the available versions for the unit. Expect: The version `0.0.0` should be listed.
curl -s https://download.eclipse.org/tools/cdt/releases/cdt-lsp-2.0/ | grep "org.yaml.snakeyaml"

Length of output: 96


Script:

#!/bin/bash
# Description: Verify the available versions for `org.yaml.snakeyaml` from Maven Central Repository.

# Test: Check the available versions for the unit. Expect: The version `0.0.0` should be listed if it exists.
curl -s "https://search.maven.org/solrsearch/select?q=g:org.yaml+AND+a:snakeyaml&rows=20&wt=json" | jq '.response.docs[] | .v'

Length of output: 133


Script:

#!/bin/bash
# Description: Verify the available versions for `org.yaml.snakeyaml` from Maven Central Repository.

# Test: Check the available versions for the unit. Expect: The version `0.0.0` should be listed if it exists.
curl -s "https://search.maven.org/solrsearch/select?q=g:org.yaml+AND+a:snakeyaml&rows=100&wt=json" | jq '.response.docs[] | .v'

Length of output: 134


Script:

#!/bin/bash
# Description: Verify the available versions for `org.yaml.snakeyaml` from the GitHub repository.

# Test: Check the available versions for the unit. Expect: The version `0.0.0` should be listed if it exists.
curl -s "https://api.github.com/repos/snakeyaml/snakeyaml/releases" | jq '.[].tag_name'

Length of output: 87

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 55e3122 and 06c19de.

Files selected for processing (1)
  • releng/com.espressif.idf.target/com.espressif.idf.target.target (1 hunks)
Additional comments not posted (2)
releng/com.espressif.idf.target/com.espressif.idf.target.target (2)

91-91: Verify the new repository location.

The repository location has been updated to https://download.eclipse.org/tools/cdt/releases/cdt-lsp-2.0/. Ensure that this URL is correct and accessible.

Verification successful

The new repository location is correct and accessible.

The URL https://download.eclipse.org/tools/cdt/releases/cdt-lsp-2.0/ returned a status code of 200, confirming its accessibility.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the accessibility of the new repository location.

# Test: Access the new repository URL. Expect: HTTP status 200.
curl -I https://download.eclipse.org/tools/cdt/releases/cdt-lsp-2.0/

Length of output: 843


92-92: Verify the unit version for org.eclipse.cdt.lsp.feature.feature.group.

The version has been changed to 0.0.0. Ensure that this version is correct and intentional.

Copy link

@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.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java (1)

43-45: Enhance exception logging for broader catch block.

Handling Exception can mask specific issues. Ensure logging provides enough context to diagnose problems effectively.

- Logger.log(e);
+ Logger.log("Error restarting LSP server: ", e);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 06c19de and a70dc48.

Files selected for processing (3)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java (2 hunks)
  • bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (3 hunks)
  • releng/com.espressif.idf.target/com.espressif.idf.target.target (5 hunks)
Additional comments not posted (10)
bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java (7)

Line range hint 28-33: LGTM! Clangd path retrieval is robust.

The method uses Optional to handle null values gracefully, ensuring a default path is returned if necessary.


37-41: LGTM! Toolchain path handling is effective.

The method appropriately uses Optional to handle null values, ensuring an empty string is returned when necessary.


45-48: LGTM! Default configuration for useTidy is clear.

The method returns a fixed value, which is suitable for a default configuration.


51-54: LGTM! Default configuration for useBackgroundIndex is clear.

The method returns a fixed value, which is suitable for a default configuration.


57-60: LGTM! Default completion style is set.

The method returns a fixed string, which is appropriate for defining a default style.


63-66: LGTM! Default configuration for prettyPrint is clear.

The method returns a fixed value, which is suitable for a default configuration.


69-72: LGTM! Default additional options are set.

The method returns an empty list, which is a sensible default for additional options.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java (1)

11-12: LGTM! Import updates align with package restructuring.

The changes in import statements reflect the updated package structure, ensuring correct references.

releng/com.espressif.idf.target/com.espressif.idf.target.target (2)

6-6: LGTM! Repository URL updates are correct.

The URLs have been updated to the latest versions, ensuring access to the most recent updates and features.

Also applies to: 22-22, 98-98


99-103: LGTM! Dependency version updates are correct.

The dependencies have been updated to the latest versions, ensuring compatibility and access to new features.

Also applies to: 137-138

@AndriiFilippov
Copy link
Collaborator

AndriiFilippov commented Aug 10, 2024

@kolipakakondal hi !

Tested under:
OS - Windows 11 / MacOS/ Linux

able to see clangd preferences ✅
able to build project ✅
do see text highlighted and able to navigate to function definition ✅

LGTM 👍

@kolipakakondal kolipakakondal merged commit 8784a80 into master Aug 12, 2024
5 of 6 checks passed
@kolipakakondal kolipakakondal deleted the IEP-1291 branch August 12, 2024 04:51
@kolipakakondal kolipakakondal added this to the v3.1.0 milestone Aug 12, 2024
@coderabbitai coderabbitai bot mentioned this pull request Sep 13, 2024
3 tasks
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.

Updating Eclipse breaks ESP-IDE's LSP Editor (IEP-1291)
3 participants