promptFilesLocator.ts ×6

Frontier kind: Code frontier

unlabeled · c_889ea6041896

8 tests · 29788 LOC · 148 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3435 ranges29788 lines · 148 files · Browse complete extent
All tests (intent)
8 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.

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

src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.ts 23 introduced LOC · 6 ranges

Open complete file

107 const workspaceFolders = this.getWorkspaceFolders();
108 if (includeParents) {
109 > const roots = new ResourceSet(); promptFilesLocator.ts
110 > const userHome = await this.pathService.userHome();
111 > for (const workspaceFolder of workspaceFolders) {
112 > roots.add(workspaceFolder.uri);
113 > // Walk up from the workspace folder to find the repository root
114 > // (.git folder). Only include parent folders if a repo root is
115 > // actually found; otherwise keep only the workspace folder.
116 > const parents = await this.findParentRepoFolders(workspaceFolder.uri, userHome, roots, logger);
117 > for (const parent of parents) {
118 roots.add(parent);
119 }
121 > return [...roots];
122 > }
123 return workspaceFolders.map(f => f.uri);
124 }
132 */
133 private async findParentRepoFolders(folderUri: URI, userHome: URI, seen: ResourceSet, logger?: Logger): Promise<URI[]> {
134 > const candidates: URI[] = []; promptFilesLocator.ts
135 > let current = folderUri;
136 > while (true) {
137 > try {
138 > const isRepoRoot = await this.fileService.exists(joinPath(current, '.git'));
139 > if (isRepoRoot) {
140 if ((await this.workspaceTrustManagementService.getUriTrustInfo(current)).trusted) {
141 candidates.push(current);
145 return []; // if the repo root isn't trusted, don't include it or any parents
146 }
147 > } catch (e) { promptFilesLocator.ts
148 const msg = e instanceof Error ? e.message : String(e);
149 logger?.logInfo(`No repository root found for folder ${folderUri.toString()}. Error accessing ${joinPath(current, '.git')}: ${msg}.`);
155 // of dirname, e.g. '/' or a Windows drive root like 'D:\'),
156 // the user home directory, or an already-seen folder.
157 > if (isEqual(current, parent) || current.path === '/' || isEqual(userHome, parent) || seen.has(parent)) { promptFilesLocator.ts
158 break;
159 }
161 }
162 // no repo found
163 > logger?.logInfo(`No repository root found for folder ${folderUri.toString()}.`); promptFilesLocator.ts
164 > return [];
165 > }
166
167 /**