Skip to content

feat: add commenting ranges for new file versions in diff

Tomas Vik requested to merge 340-commenting-range-for-new-diff-file into main

This MR is a follow up for !232 (merged). It introduces the commenting range (grey vertical lines) for new files (highlighted orange on the screenshot).

Extension_Development_Host_-_test_ts___7____test-project

We parse the MR version REST API response into hunks. These hunks tell us what lines have been added in the new file version on the diff. We then convert these lines in VS Code Ranges and return them as ranges on which the user might leave a comment.

Feature flags

We can't show the commenting ranges till we implement #342 (closed). Otherwise, users would think they can comment on any line.

The commenting ranges feature is hidden behind commenting-ranges feature flag. You can enable it by adding the following config to your settings.json VS Code settings:

{
  "gitlab.featureFlags": ["commenting-ranges"]
}

Related to #340 (closed)

Edited by Tomas Vik

Merge request reports