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
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 43,077
    • Issues 43,077
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,379
    • Merge requests 1,379
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #21762
Closed
Open
Created Apr 05, 2018 by Dimitrie Hoekstra@dimitrieh🔥Contributor

Implement linking to a single line number in Web IDE

Problem to Solve

Users often need to reference specific lines of files. You can do this in the repository view, but you're unable to link directly to a line to begin to edit a file in that position or share that link with someone as a reference point for discussion to begin editing.

Proposal

The Web IDE should support a hyperlink syntax that can reference a line number.

UX Proposal

  • Appending #LXX to the end of a Web IDE URL should cause the associated file to be opened with the line number (XX) to be visible with the cursor placed at the end of the line.
    • If the line referenced is not near the end or beginning of the file, the view should be scrolled so that 2.5 lines above the referenced line are visible.

image

  • Hovering a line in the editor should show a link icon with a link to the file including #LXX

image

Out of Scope

  • Linking to a range of lines
  • Special link formatting/syntax for usage in GitLab Markdown

Additional Considerations

  • The context of the editor needs to be considered when linked - review/edit mode

Availability and Testing

New tests required (system tests and one E2E), including coverage for the case when the user needs to link a line that also has a comment (see #249625) and the negative case when the linked line doesn't exist. Please include the SET (@a_mcdonald) in the MR review.

Edited Nov 17, 2020 by Anastasia McDonald
Assignee
Assign to
Time tracking