Support multi-line suggestions
What does this MR do?
What it supports
Extend the existing
suggestion syntax to support multi-line suggestions allowing
x is a positive number.
In that case, the suggestion will target the replacement of:
- Example 1: Using
suggestion:+1translates into replace from the commented (this) line to 1 line below by the provided content.
- Example 2: Using
suggestion:+3translates into replace from the commented (this) line to 3 lines below by the provided content.
- Example 3: Using
suggestion:-3+4translates into _replace from the commented (this) line to 3 lines above and 4 lines below by the provided content.
Support parsing the
suggestionscomplete data on Preview request backend
- Make necessary changes on frontend to present the Preview reliably (pre-persistence)
If a surpassing context is given (
-30if we're at line
7, go up to the limit, i.e. line 1. Save that offset into
lines_aboveso we can know the context we need to track in order to outdate) backend
diff_lineswith correct old and new lines to FE (for
When any of the changing lines of a suggestion changes, outdate the
suggestion. This check needs to be made whenever a MR receives an update. A new column will be needed. This could be done on the fly, though, it's not cheap. backend
bug Preview diff refs are not right for preview (
/diffsshould use the latest revision)
- Present Preview reliably (post-persistence) frontend
- Make sure lack of limitation won't be a technical limitation
- Get all backend MRs merged and add glue code on this MR
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Documentation created/updated via this MR
- Documentation reviewed by technical writer or follow-up review issue created
- Tests added for this feature/bug
- Tested in all supported browsers
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the database guides
- Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
- Security reports checked/validated by reviewer