vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Added `getAmountOfDiffs` and `getIndexOfCurrentlyRevealedDiff` to the IDiffEditor

Open MathiasWP opened this issue 10 months ago • 1 comments

Fixes https://github.com/microsoft/monaco-editor/issues/4836.

This PR implements two API's:

  • getAmountOfDiffs: A helper method to know the current amount of diffs rendered in the IDiffEditor
  • getIndexOfCurrentlyRevealedDiff: A helper method to get the index of the currently revealed diff

I was wondering if the getIndexOfCurrentlyRevealedDiff could instead be called getCurrentlyRevealedDiff and return an object containing { index: number, diff: DiffMapping }, but i'm not sure if you want DiffMapping to be exposed.

These methods would be really helpful for giving helpful information about the diffs. The goToDiff and revealFirstDiff are great for navigating diffs, but if you want to display some information about the diffs then it's not really possible with the current setup.

MathiasWP avatar Feb 22 '25 13:02 MathiasWP

@microsoft-github-policy-service agree

MathiasWP avatar Feb 22 '25 13:02 MathiasWP