chatModes.ts ×8

Frontier kind: Code frontier

unlabeled · c_a5859dbf04f5

3 tests · 50660 LOC · 228 files · introduces 0 tests · 29 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges29 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4382 ranges50660 lines · 228 files · Browse complete extent
All tests (intent)
3 testsBrowse complete intent

Neighbourhood graph

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.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 29 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatModes.ts 27 introduced LOC · 8 ranges

Open complete file

261 let modeInstance = this._customModeInstances.get(uriString);
262 if (modeInstance) {
263 > // Update existing instance with new data chatModes.ts
264 > if (modeInstance.updateData(customMode)) {
265 hasChanges = true;
266 }
426 export namespace IChatModeInstructions {
427 export function isEquals(a: IChatModeInstructions | undefined, b: IChatModeInstructions | undefined): boolean {
428 > if (a === b) { chatModes.ts
429 return true;
430 }
431 > if (!a || !b) { chatModes.ts
432 return false;
433 }
435 objectEquals(a.toolReferences, b.toolReferences) &&
436 objectEquals(a.metadata, b.metadata);
437 > } chatModes.ts
438
439 }
568 */
569 updateData(newData: ICustomAgent): boolean {
570 > let hasChanges = false; chatModes.ts
571 >
572 > transaction(tx => {
573 > const update = <T>(observable: ISettableObservable<T | undefined>, newValue: T | undefined, equals: (a: T | undefined, b: T | undefined) => boolean = (a, b) => a === b) => {
574 > if (!equals(observable.get(), newValue)) {
575 observable.set(newValue, tx);
576 hasChanges = true;
577 }
578 > }; chatModes.ts
579 > update(this._nameObservable, newData.name);
580 > update(this._descriptionObservable, newData.description);
581 > update(this._customToolsObservable, newData.tools, arraysEqual);
582 > update(this._modelObservable, newData.model, arraysEqual);
583 > update(this._argumentHintObservable, newData.argumentHint);
584 > update(this._modeInstructions, newData.agentInstructions, IChatModeInstructions.isEquals);
585 > update(this._uriObservable, newData.uri, isURLEquals);
586 > update(this._handoffsObservable, newData.handOffs, objectEquals);
587 > update(this._targetObservable, newData.target);
588 > update(this._visibilityObservable, newData.visibility, objectEquals);
589 > update(this._agentsObservable, newData.agents, arraysEqual);
590 > if (!IAgentSource.isEquals(this._source, newData.source)) {
591 this._source = newData.source;
592 hasChanges = true;
593 }
594 > if (!arraysEqual(this._sessionTypes, newData.sessionTypes)) { chatModes.ts
595 this._sessionTypes = newData.sessionTypes;
596 hasChanges = true;
597 }
598 > }); chatModes.ts
599 > return hasChanges;
600 > }
601
602 toJSON(): IChatModeData {
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts 2 introduced LOC · 1 range

Open complete file

236 export function isEquals(a: IAgentSource | undefined, b: IAgentSource | undefined): boolean {
237 if (a === b) {
238 > return true; promptsService.ts
239 > }
240 if (!a || !b) {
241 return false;