feat: Add user setting for agentic edit diff-open behavior

Description

Adds a user setting for agentic edit diff-open behavior

Resolves Add configurable diff display behavior for file... (gitlab-org/editor-extensions/gitlab-lsp#1793)

How has this been tested?

To test the diff edit behavior:

  1. Open a project that has agentic chat configured.
  2. Ask it to edit a file
    • e.g. Remove the first line in src/node/fetch.ts
  3. Observe the behavior.

To switch settings:

  1. Open the settings UI (Cmd + Shift + P -> Preferences: Open Settings (UI)).
  2. Filter for gitlab.duoAgentPlatform.editFileDiffBehavior.
  3. Select the various options.

Note: VS Code doesn't 'fetch' the diff contents until you focus the tab for the first time. This leads to special garbage handling. So it's worth testing different combinations of editing - e.g. having an agent edit the same file twice and ensuring the result is consistent.

  • If src/browser or src/common has been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE.
  • Consider an end-to-end test for significant new features that aren't covered by integration tests.

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Tristan Read

Merge request reports

Loading