Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getAmountOfDiffs and getIndexOfCurrentlyRevealedDiff to the IDiffEditor #241579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MathiasWP
Copy link

@MathiasWP MathiasWP commented Feb 22, 2025

Fixes microsoft/monaco-editor#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
Copy link
Author

@microsoft-github-policy-service agree

@aiday-mar aiday-mar assigned hediet and unassigned aiday-mar Feb 24, 2025
@aiday-mar aiday-mar requested a review from hediet February 24, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add API for getting the currently viewed diff and total diffs in the IDiffEditor
3 participants