MCPcopy Index your code
hub / github.com/desktop/desktop / isSelected

Method isSelected

app/src/models/diff/diff-selection.ts:122–136  ·  view source on GitHub ↗

Returns a value indicating wether the given line number is selected or not

(lineIndex: number)

Source from the content-addressed store, hash-verified

120
121 /** Returns a value indicating wether the given line number is selected or not */
122 public isSelected(lineIndex: number): boolean {
123 const lineIsDivergent =
124 !!this.divergingLines && this.divergingLines.has(lineIndex)
125
126 if (this.defaultSelectionType === DiffSelectionType.All) {
127 return !lineIsDivergent
128 } else if (this.defaultSelectionType === DiffSelectionType.None) {
129 return lineIsDivergent
130 } else {
131 return assertNever(
132 this.defaultSelectionType,
133 `Unknown base selection type ${this.defaultSelectionType}`
134 )
135 }
136 }
137
138 /**
139 * Returns a value indicating whether the range is all selected, partially

Callers 5

isRangeSelectedMethod · 0.95
formatPatchFunction · 0.80
isInSelectionFunction · 0.80

Calls 1

assertNeverFunction · 0.90

Tested by

no test coverage detected