clear(): void {
this._responseParts = [];
this._contentChanged(true);
}
clearToPreviousToolInvocation(message?: string): void {
Frontier kind: Code frontier
unlabeled · c_1418565daef4
84 tests · 45243 LOC · 194 files · introduces 0 tests · 121 LOC · 3 files
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService untitled session materialization is idempotent/serialized (avoids duplicate sessions) a failed materialization does not poison the latch (retry re-attempts)|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService untitled session materialization is idempotent/serialized (avoids duplicate sessions) a load failure after alias registration does not poison the late-send re-target|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/model/chatModel.test|title=ChatModel - Pending Requests addPendingRequest - fires onDidChangePendingRequests event|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/model/chatModel.test|title=ChatModel - Pending Requests pending requests preserve send options|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 121 introduced LOC across 27 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
clear(): void {
this._responseParts = [];
this._contentChanged(true);
}
clearToPreviousToolInvocation(message?: string): void {
public get shouldBeRemovedOnSend() {
}
public get isComplete(): boolean {
constructor(params: IChatResponseModelParameters) {
this._session = params.session;
this._agent = params.agent;
this._slashCommand = params.slashCommand;
this.requestId = params.requestId;
this._timestamp = params.timestamp || Date.now();
if (params.modelState) {
this._modelState.set(params.modelState, undefined);
}
? undefined
: params.completionTimestamp ?? (params.modelState && 'completedAt' in params.modelState ? params.modelState.completedAt : undefined);
chatModel.ts
this._timeSpentWaitingAccumulator = params.timeSpentWaiting || 0;
this._elapsedMs = params.elapsedMs;
this._vote = params.vote;
this._result = params.result;
this._followups = params.followups ? [...params.followups] : undefined;
this.isCompleteAddedRequest = params.isCompleteAddedRequest ?? false;
this._shouldBeRemovedOnSend = params.shouldBeRemovedOnSend;
this._shouldBeBlocked.set(params.shouldBeBlocked ?? false, undefined);
// If we are creating a response with some existing content, consider it stale
this._isStale = Array.isArray(params.responseContent) && (params.responseContent.length !== 0 || isMarkdownString(params.responseContent) && params.responseContent.value.length !== 0);
this._response = this._register(new Response(params.responseContent));
this._codeBlockInfos = params.codeBlockInfos ? [...params.codeBlockInfos] : undefined;
const signal = observableSignalFromEvent(this, this.onDidChange);
const _pendingInfo = signal.map((_value, r): string | undefined => {
signal.read(r);
for (const part of this._response.value) {
if (part.kind === 'toolInvocation') {
const state = part.state.read(r);
}
}
return undefined;
});
const _startedWaitingAt = _pendingInfo.map(p => !!p).map(p => p ? Date.now() : undefined);
this.isPendingConfirmation = _startedWaitingAt.map((waiting, r) => waiting ? { startedWaitingAt: waiting, detail: _pendingInfo.read(r) } : undefined);
this.isInProgress = signal.map((_value, r) => {
signal.read(r);
return !_pendingInfo.read(r)
&& !this.shouldBeRemovedOnSend
&& (this._modelState.read(r).value === ResponseModelState.Pending || this._modelState.read(r).value === ResponseModelState.NeedsInput);
});
this.isIncomplete = this._modelState.map(state => {
return state.value === ResponseModelState.Pending || state.value === ResponseModelState.NeedsInput;
this._register(this._response.onDidChangeValue(() => this._onDidChange.fire(defaultChatResponseModelChangeReason)));
this.id = params.restoredId ?? 'response_' + generateUuid();
let lastStartedWaitingAt: number | undefined = undefined;
this.confirmationAdjustedTimestamp = derived(reader => {
const pending = this.isPendingConfirmation.read(reader);
if (pending) {
this._modelState.set({ value: ResponseModelState.NeedsInput }, undefined);
if (!lastStartedWaitingAt) {
lastStartedWaitingAt = pending.startedWaitingAt;
}
// Restore state to Pending if it was set to NeedsInput by this observable
if (this._modelState.read(reader).value === ResponseModelState.NeedsInput) {
lastStartedWaitingAt = undefined;
}
return this._timestamp + this._timeSpentWaitingAccumulator;
}).recomputeInitiallyAndOnChange(this._store);
}
initializeCodeBlockInfos(codeBlockInfo: ICodeBlockInfo[]): void {
override dispose(): void {
this._response.clear();
if (this._codeBlockInfos) {
this._codeBlockInfos.length = 0;
}
toJSON(): Omit<ISerializableChatResponseData, 'timestamp'> {
return;
}
reader.store.add(request.response.onDidChange(async ev => {
if (!this._editingSession || ev.reason !== 'completedRequest') {
return;
this._onDidChange.fire({ kind: 'completedRequest', request });
}));
if (data.owner !== undefined) {
if (key !== undefined) {
return ownerStr + key;
}
return undefined;
}
for (const key in obj) {
if ((obj as Record<string, unknown>)[key] === value) {
return key;
}
return undefined;
}
const countPerClassName = new Map<string, number>();
const ownerId = new WeakMap<object, string>();
const id = ownerId.get(owner);
if (id) {
return id;
}
let count = countPerClassName.get(className) ?? 0;
count++;
countPerClassName.set(className, count);
const result = count === 1 ? className : `${className}#${count}`;
ownerId.set(owner, result);
return result;
}
export function getClassName(obj: object): string | undefined {
if (ctor) {
if (ctor.name === 'Object') {
return undefined;
}
}
return undefined;
}
export function observableSignalFromEvent(
event: Event<any>,
debugLocation = DebugLocation.ofCaller()
): IObservable<void> {
return new FromEventObservableSignal(typeof owner === 'string' ? owner : new DebugNameData(owner, undefined, undefined), event, debugLocation);
}
class FromEventObservableSignal extends BaseObservable<void> {
public readonly debugName: string;
constructor(
private readonly event: Event<any>,
debugLocation: DebugLocation
) {
super(debugLocation);
this.debugName = typeof debugNameDataOrName === 'string'
? debugNameDataOrName
: debugNameDataOrName.getDebugName(this) ?? 'Observable Signal From Event';
observableSignalFromEvent.ts
}
protected override onFirstObserverAdded(): void {
}
private readonly handleEvent = () => {
protected override onLastObserverRemoved(): void {
this.subscription = undefined;
}
public override get(): void {
}
}