Skip to content
Snippets Groups Projects

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 and to_content correctly
  • If a surpassing context is given (-30 if we're at line 7, go up to the limit, i.e. line 1. Save that offset into lines_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 (for references.suggestions and note.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

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53310

Does this MR meet the acceptance criteria?

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Checking pipeline status.

Approved by

Merged by Douwe MaanDouwe Maan Apr 4, 2019 (Apr 4, 2019 1:08pm UTC)

Merge details

  • Changes merged into master with f4ab02b1 (commits were squashed).
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Oswaldo Ferreira
  • Oswaldo Ferreira marked the checklist item as completed
  • Oswaldo Ferreira changed the description
  • Oswaldo Ferreira changed the description
  • Oswaldo Ferreira changed the description
  • Oswaldo Ferreira added 2 commits
  • Oswaldo Ferreira marked the checklist item as completed
  • Oswaldo Ferreira
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please or to reply
    Loading