DiffRegionStore
DiffRegionStore =
object
Which collapsed regions are expanded, and who owns that answer.
Split mode is two editors holding two documents, which means two plugin instances — and a separator row is one region shown twice, once per side. If each instance kept its own expansion set, one gutter click would expand the left pane and leave the right where it was, and every row below would be misaligned. That is the single property split mode exists to hold (§C7).
So expansion is a store the sides share rather than state each side owns. A host building a split view creates one store and passes it to both plugins; a stacked host passes nothing and gets a private one. This is not the mirroring §C5 forbids — nobody is keeping a second copy in sync. There is one copy, and both sides read it.
Methods
Section titled “Methods”getExpandedRegions()
Section titled “getExpandedRegions()”getExpandedRegions():
ReadonlySet<string>
Returns
Section titled “Returns”ReadonlySet<string>
isExpanded()
Section titled “isExpanded()”isExpanded(
key):boolean
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
onDidChange()
Section titled “onDidChange()”onDidChange(
listener):EditorDisposable
Parameters
Section titled “Parameters”listener
Section titled “listener”() => void
Returns
Section titled “Returns”EditorDisposable
setFile()
Section titled “setFile()”setFile(
file):void
Points the store at a diff. Expansion is per diff, not per path — see the note below — so this drops the current set whenever the identity changes.
Parameters
Section titled “Parameters”DiffFile | null
Returns
Section titled “Returns”void
toggleRegion()
Section titled “toggleRegion()”toggleRegion(
key):void
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void