Skip to content

Commit 836e2e0

Browse files
u1: move the two profile-record declarations to the units that carry their readers
sharedStoreCarriesProfileRecord is called only from the hunk unit 3 carries (1921 head ClineProvider.ts:3840); ProfileActivationInconsistentError is used only from the hunks unit 2 carries (1921 head :3350 and :4465). Carrying a declaration whose readers live in another unit leaves it unreachable in the unit that owns it, which is what made eslint report 2 no-unused-vars problems on this unit, and it is the carrier rule broken in the opposite direction from the guard test: the guard travelled with its readers, these two did not. Both declarations move out of this unit and no call site moves to keep a declaration in place. Until unit 3's head exists on a remote, sharedStoreCarriesProfileRecord exists in no pushed ref, which the unit body and the plan of record say rather than smooth over. Hooks: state this plainly. This commit is being made in the campaign scratch worktree where pnpm 10.8.1 is on PATH and where this round ran check-types and eslint, so husky's pre-commit is able to run; the hook result for this commit is recorded in the campaign ledger for this round from the commit's own output, not asserted here.
1 parent bece7f0 commit 836e2e0

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

‎src/core/webview/ClineProvider.ts‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -253,34 +253,6 @@ function removeTaskEventListeners(listeners: WeakMap<Task, Array<() => void>>, t
253253
}
254254
}
255255

256-
/**
257-
* Whether the shared provider-settings store still carries this profile's stored record.
258-
* The store normalizes every provider's keys on write, so a key the record does not
259-
* mention and a key whose stored value is `undefined` are the same value here.
260-
*/
261-
function sharedStoreCarriesProfileRecord(store: ProviderSettings, record: Record<string, unknown>): boolean {
262-
const storeValues = new Map<string, unknown>(Object.entries(store))
263-
const recordValues = new Map<string, unknown>(Object.entries(record))
264-
for (const key of new Set([...storeValues.keys(), ...recordValues.keys()])) {
265-
if (storeValues.get(key) !== recordValues.get(key)) {
266-
return false
267-
}
268-
}
269-
return true
270-
}
271-
272-
/**
273-
* Raised when a profile activation or upsert failed after durable writes landed and at least one
274-
* compensating write failed too. The persisted profile stores may now disagree, which is not the
275-
* ordinary "the save failed and nothing changed" outcome the caller's `undefined` would suggest.
276-
*/
277-
class ProfileActivationInconsistentError extends Error {
278-
constructor(message: string) {
279-
super(message)
280-
this.name = "ProfileActivationInconsistentError"
281-
}
282-
}
283-
284256
export class ClineProvider
285257
extends EventEmitter<TaskProviderEvents>
286258
implements vscode.WebviewViewProvider, TelemetryPropertiesProvider, TaskProviderLike

0 commit comments

Comments
 (0)