promptFileLocations.ts ×6

Frontier kind: Joint frontier

unlabeled · c_94838421b370

1 test · 30698 LOC · 163 files · introduces 1 test · 45 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges45 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
3471 ranges30698 lines · 163 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: 45 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.ts 35 introduced LOC · 1 range

Open complete file

425 return absoluteLocations.map(l => l.uri);
426 }
428 > // locations in the settings can contain glob patterns so we need
429 > // to process them to get "clean" paths; the goal here is to have
430 > // a list of unambiguous folder paths where prompt files are stored
431 > const result = new ResourceSet();
432 > for (const absoluteLocation of absoluteLocations) {
433 > let location = absoluteLocation.uri;
434 > const baseName = basename(location);
435 >
436 > // if a path ends with a well-known "any file" pattern, remove
437 > // it so we can get the dirname path of that setting value
438 > const filePatterns = ['*.md', `*${getPromptFileExtension(type)}`];
439 > for (const filePattern of filePatterns) {
440 > if (baseName === filePattern) {
441 > location = dirname(location);
442 > continue;
443 > }
444 > }
445 >
446 > // likewise, if the pattern ends with single `*` (any file name)
447 > // remove it to get the dirname path of the setting value
448 > if (baseName === '*') {
449 > location = dirname(location);
450 > }
451 >
452 > // if after replacing the "file name" glob pattern, the path
453 > // still contains a glob pattern, then ignore the path
454 > if (isValidGlob(location.path) === true) {
455 > continue;
456 > }
457 >
458 > result.add(location);
459 > }
460 >
461 > return [...result];
462 }
463
src/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations.ts 10 introduced LOC · 6 ranges

Open complete file

297
298 export function getPromptFileExtension(type: PromptsType): string {
299 > switch (type) { promptFileLocations.ts
300 > case PromptsType.instructions:
301 return INSTRUCTION_FILE_EXTENSION;
302 > case PromptsType.prompt: promptFileLocations.ts
303 > return PROMPT_FILE_EXTENSION;
304 > case PromptsType.agent:
305 return AGENT_FILE_EXTENSION;
306 > case PromptsType.skill: promptFileLocations.ts
307 return SKILL_FILENAME;
308 > case PromptsType.hook: promptFileLocations.ts
309 return '.json';
310 > default: promptFileLocations.ts
311 throw new Error('Unknown prompt type');
313 > }
314
315 export function getPromptFileDefaultLocations(type: PromptsType): readonly IPromptSourceFolder[] {