Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !25211

Support multi-line suggestions

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Oswaldo Ferreira requested to merge osw-support-multi-line-suggestions into master Feb 13, 2019
  • Overview 140
  • Commits 35
  • Pipelines 89
  • Changes 36

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

  • 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 Dec 08, 2020 by 🤖 GitLab Bot 🤖
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: osw-support-multi-line-suggestions