chatVariableEntries.ts ×5

Frontier kind: Joint frontier

unlabeled · c_df5df83e027c

1 test · 45132 LOC · 194 files · introduces 1 test · 28 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges28 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4237 ranges45132 lines · 194 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts 21 introduced LOC · 5 ranges

Open complete file

588
589 export function toExport(v: IChatRequestVariableEntry): IChatRequestVariableEntry {
590 > if (v.value instanceof Uint8Array) { chatVariableEntries.ts
591 // 'dup' here is needed otherwise TS complains about the narrowed `value` in a spread operation
592 const dup: Mutable<IChatRequestVariableEntry> = { ...v };
594 return dup;
595 }
597 > return v;
598 > }
599
600 export function fromExport(v: IChatRequestVariableEntry): IChatRequestVariableEntry {
626
627 export function isImplicitVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestImplicitVariableEntry {
628 > return obj.kind === 'implicit'; chatVariableEntries.ts
629 > }
630
631 export function isStringVariableEntry(obj: IChatRequestVariableEntry): obj is IChatRequestStringVariableEntry {
632 > return obj.kind === 'string'; chatVariableEntries.ts
633 > }
634
635 export function isTerminalVariableEntry(obj: IChatRequestVariableEntry): obj is ITerminalVariableEntry {
723
724 export function isStringImplicitContextValue(value: unknown): value is StringChatContextValue {
725 > const asStringImplicitContextValue = value as Partial<StringChatContextValue>; chatVariableEntries.ts
726 > return (
727 > typeof asStringImplicitContextValue === 'object' &&
728 > asStringImplicitContextValue !== null &&
729 > (typeof asStringImplicitContextValue.value === 'string' || typeof asStringImplicitContextValue.value === 'undefined') &&
730 > (typeof asStringImplicitContextValue.name === 'string' || typeof asStringImplicitContextValue.name === 'undefined') &&
731 > (asStringImplicitContextValue.resourceUri === undefined || URI.isUri(asStringImplicitContextValue.resourceUri)) &&
732 > (typeof asStringImplicitContextValue.name === 'string' || URI.isUri(asStringImplicitContextValue.resourceUri)) &&
733 > (asStringImplicitContextValue.iconPath === undefined || isChatContextIconPath(asStringImplicitContextValue.iconPath)) &&
734 > URI.isUri(asStringImplicitContextValue.uri) &&
735 > typeof asStringImplicitContextValue.handle === 'number'
736 > );
737 > }
738
739 export enum PromptFileVariableKind {
src/vs/workbench/contrib/chat/common/model/chatModel.ts 7 introduced LOC · 1 range

Open complete file

2246 // These have handles that become invalid after window reload and cannot be properly restored.
2247 const persistableAttachments = value.attachments.filter(attachment => {
2248 > if (isStringVariableEntry(attachment)) { chatModel.ts
2249 > return false;
2250 > }
2251 > if (isImplicitVariableEntry(attachment) && isStringImplicitContextValue(attachment.value)) {
2252 > return false;
2253 > }
2254 > return true;
2255 });
2256