Skip to content

[Feature Request] Add code suggestion for PR review comments #14765

Open
@delvh

Description

@delvh
  • Gitea version (or commit ref): 1.14.0+dev-740-g7118347ba

Description

GitHub supports the option to add code suggestions that can automatically overwrite the current code if committed. The user has the option to add infinitely many suggestions together in a batch before committing all in one single code review commit.
Any code review comment can contain suggestions by simply using

```suggestion
``` (no text here, solely exists so that the quotes at the beginning will be displayed correctly)

The text that gets replaced is the text selected for this comment, resulting in this issue being effectively blocked until #12640 gets merged.
Of course, it would already be possible to implement, but limited to single-line code suggestions for now.

Later on, this feature could even be enhanced to use additional language highlighting, so that the recommendations would even be displayed in the style of the given language. This could look something like this then:

```<language> suggestion

, for example

```go suggestion

This is a useful feature as it allows integrating code suggestions way quicker and without the help of any external tool, where each change has to be manually located first.

Screenshots

Current design on GitHub:
image

behavior when there are multiple suggestions in one comment:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposal/acceptedWe have reviewed the proposal and agree that it should be implemented like that/at all.topic/prIssues related to pull requeststype/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions