Support multi-line suggestions
What does this MR do?
What it supports
Extend the existing suggestion
syntax to support multi-line suggestions allowing suggestion:+<x>
, where
x
is a positive number.
In that case, the suggestion will target the replacement of:
<current-line>..<current-line>+<x>
- Example 1: Using
suggestion:+1
translates into replace from the commented (this) line to 1 line below by the provided content. - Example 2: Using
suggestion:+3
translates into replace from the commented (this) line to 3 lines below by the provided content. - Example 3: Using
suggestion:-3+4
translates into _replace from the commented (this) line to 3 lines above and 4 lines below by the provided content.
TODO
-
Support parsing the suggestion:-X+Y
syntax -
Return suggestions
complete data on Preview request backend -
Make necessary changes on frontend to present the Preview reliably (pre-persistence) -
Persist from_content
andto_content
correctly -
If a surpassing context is given ( -30
if we're at line7
, go up to the limit, i.e. line 1. Save that offset intolines_above
so we can know the context we need to track in order to outdate) backend -
Return diff_lines
with correct old and new lines to FE (forreferences.suggestions
andnote.suggestions
) backend -
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 ( /diffs
should 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
Backend split
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26069
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26057
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26107
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53310
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
Edited by 🤖 GitLab Bot 🤖