Skip to content

Implement Bitbucket-style code suggestion feature #8

@Philipp0205

Description

@Philipp0205

Summary

Add support for suggesting specific code changes directly in review comments, similar to Bitbucket's suggestion feature that allows reviewers to propose changes that can be applied with one click.

User Story

As a code reviewer, I want to suggest specific code changes inline, so that the author can apply my suggestions directly without manually copying and editing code.

Proposed Solution

  • Add UI action to "Suggest change" when creating inline comments
  • Render suggested code blocks with syntax highlighting
  • Display diff preview showing current vs. suggested code
  • Provide "Apply suggestion" button for PR authors
  • Generate commit or local change when suggestion is applied
  • Support both GitHub and Bitbucket suggestion formats

Acceptance Criteria

  • Reviewers can create suggestions when commenting on code lines
  • Suggestions are clearly distinguished from regular comments
  • Diff preview shows current code vs. suggested change
  • Authors can apply suggestions with one action
  • Applied suggestions create appropriate commits or local changes
  • Works for both single-line and multi-line suggestions
  • Compatible with GitHub and Bitbucket APIs

Technical Considerations

  • GitHub: Uses markdown code blocks with suggestion language tag
  • Bitbucket: Uses specific suggestion API format
  • Need to parse suggestion syntax from comment markdown
  • Apply suggestions via JGit working tree modifications or provider API
  • Handle conflicts when suggested code no longer matches current state
  • Consider integration with Eclipse's quick fix/refactoring UI patterns

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions