ripgrepFileSearch.ts ×8

Frontier kind: Code frontier

unlabeled · c_7c89310f9ded

33 tests · 10550 LOC · 47 files · introduces 0 tests · 36 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges36 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1546 ranges10550 lines · 47 files · Browse complete extent
All tests (intent)
33 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: 36 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/services/search/node/ripgrepFileSearch.ts 36 introduced LOC · 8 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- ripgrepFileSearch.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import * as cp from 'child_process';
7 > import * as path from '../../../../base/common/path.js';
8 > import * as glob from '../../../../base/common/glob.js';
9 > import { normalizeNFD } from '../../../../base/common/normalization.js';
10 > import * as extpath from '../../../../base/common/extpath.js';
11 > import { isMacintosh as isMac } from '../../../../base/common/platform.js';
12 > import * as strings from '../../../../base/common/strings.js';
13 > import { IFileQuery, IFolderQuery } from '../common/search.js';
14 > import { anchorGlob } from './ripgrepSearchUtils.js';
15 > import { rgDiskPath } from '../../../../base/node/ripgrep.js';
16 >
17 export async function spawnRipgrepCmd(config: IFileQuery, folderQuery: IFolderQuery, includePattern?: glob.IExpression, excludePattern?: glob.IExpression, numThreads?: number) {
18 const rgArgs = getRgArgs(config, folderQuery, includePattern, excludePattern, numThreads);
27 };
28 }
30 function getRgArgs(config: IFileQuery, folderQuery: IFolderQuery, includePattern?: glob.IExpression, excludePattern?: glob.IExpression, numThreads?: number) {
31 const args = ['--files', '--hidden', '--case-sensitive', '--no-require-git'];
89 };
90 }
92 > interface IRgGlobResult {
93 > globArgs: string[];
94 > siblingClauses: glob.IExpression;
95 > }
96 >
97 function foldersToRgExcludeGlobs(folderQueries: IFolderQuery[], globalExclude?: glob.IExpression, excludesToSkip?: Set<string>, absoluteGlobs = true): IRgGlobResult {
98 const globArgs: string[] = [];
109 return { globArgs, siblingClauses };
110 }
112 function foldersToIncludeGlobs(folderQueries: IFolderQuery[], globalInclude?: glob.IExpression, absoluteGlobs = true): string[] {
113 const globArgs: string[] = [];
120 return globArgs;
121 }
123 function globExprsToRgGlobs(patterns: glob.IExpression, folder?: string, excludesToSkip?: Set<string>): IRgGlobResult {
124 const globArgs: string[] = [];
159 return { globArgs, siblingClauses };
160 }
162 > /**
163 > * Resolves a glob like "node_modules/**" in "/foo/bar" to "/foo/bar/node_modules/**".
164 > * Special cases C:/foo paths to write the glob like /foo instead - see https://github.com/BurntSushi/ripgrep/issues/530.
165 > *
166 > * Exported for testing
167 > */
168 > export function getAbsoluteGlob(folder: string, key: string): string {
169 return path.isAbsolute(key) ?
170 key :
171 path.join(folder, key);
172 }
174 function trimTrailingSlash(str: string): string {
175 str = strings.rtrim(str, '\\');
176 return strings.rtrim(str, '/');
177 }
179 > export function fixDriveC(path: string): string {
180 const root = extpath.getRoot(path);
181 return root.toLowerCase() === 'c:/' ?