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

refactor: Improve DAP server code organisation and readability #6770

Merged
merged 15 commits into from
Dec 3, 2024

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Dec 3, 2024

Description

This PR improves the organization and readability of the forc-debug codebase through several changes:

  • Moves CLI functionality into a dedicated CLI module
  • Creates a unified error handling system using thiserror
  • Improves command handler organization and readability
  • Extracts common functionality into reusable helper methods
  • Adds clear documentation for public interfaces
  • Introduces the HandlerResult type to simplify DAP server response handling
  • Implements consistent error propagation throughout the codebase
  • Ran clippy pedantic

Improvements:

  • Better separation of concerns between CLI and server code
  • More descriptive error messages with proper context
  • Cleaner command handling

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@JoshuaBatty JoshuaBatty requested a review from a team as a code owner December 3, 2024 01:46
@JoshuaBatty JoshuaBatty self-assigned this Dec 3, 2024
@JoshuaBatty JoshuaBatty added the forc-debug Everything related to forc-debug label Dec 3, 2024
@JoshuaBatty JoshuaBatty marked this pull request as draft December 3, 2024 01:47
@JoshuaBatty JoshuaBatty marked this pull request as ready for review December 3, 2024 02:50
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Thanks for improving the error handling. The changes look good!

@JoshuaBatty JoshuaBatty requested a review from a team December 3, 2024 08:55
Copy link
Contributor

@tritao tritao left a comment

Choose a reason for hiding this comment

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

Good stuff 👍

@JoshuaBatty JoshuaBatty merged commit 48f633d into master Dec 3, 2024
39 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/forc-debug branch December 3, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forc-debug Everything related to forc-debug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants