Linking to a single line number in Web IDE

Merged Denys Mishunov requested to merge 21762-link-to-a-line into master

What does this MR do?

Introduces linking to a file(s) in Editor Lite. The functionality is available in all Editor Lite instances using the base extension (both single-file editor and WebIDE), or any of its derivatives.

The URL hash schema for this feature:

#L{N1}-{N2}

where {N1} and {N2} are the digits with the following meaning:

Param Is required? Description
{N1} YES The number of the first line to highlight.
{N1} NO The number of the last line to be included in highlighting.

The first line to be highlighted is centered on the screen for the convenience of the users.

Screenshots (strongly suggested)

Linking to a single line Linking to multiple lines
Single-file editor Screenshot_2021-03-10_at_00.35.39 Screenshot_2021-03-10_at_00.37.18
WebIDE Screenshot_2021-03-10_at_00.37.56 Screenshot_2021-03-10_at_00.38.48
Pipeline Editor Screenshot_2021-03-10_at_12.31.13 Screenshot_2021-03-10_at_12.30.40

This MR also introduces the "link" icon shown whenever hovering over a line number in the editor:

2021-03-10_00-41-05

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #21762 (closed)

Edited by Denys Mishunov