Skip to content

Commenting on diffs and inserting code suggestions in merge request: Add ability to select multiple lines so I can suggest to replace an entire block

Problem to solve

When reviewing a merge request, you may want to insert a code suggestion that spans multiple lines (i.e. you want to replace a code change someone wrote entirely by something else because you refuse to let go of your baby, or maybe formatting makes a single line go over three, etc.).

This is currently possible by fiddling with the auto-inserted suggestion:-N+N marker a bit until you understand how it works. I was expecting to be able to shift-click the lines I want to comment on/suggest a code block change for, like on GitHub, which would set the inserted marker up correctly.

(Also, not sure it goes here, but being able to select multiple lines to comment on in general would be useful.)

Intended users

Proposal

Add ability to select multiple lines for commenting with e.g. a shift-click in a merge request's "Changes" view.

Permissions and Security

No change I think?

Documentation

Not sure.

Testing

Not sure if anything has to change, i.e. invalidation if someone force-pushes and the suggestion becomes outdated.

What does success look like, and how can we measure that?

Increased usage of the code suggestion feature because it is easier to use maybe.

What is the type of buyer?

Core/Free.

Links / references