searchExtConversionTypes.ts ×6

Frontier kind: Code frontier

unlabeled · c_5e04a96a7502

15 tests · 79357 LOC · 282 files · introduces 0 tests · 60 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges60 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5560 ranges79357 lines · 282 files · Browse complete extent
All tests (intent)
15 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: 60 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/services/search/common/searchExtConversionTypes.ts 41 introduced LOC · 6 ranges

Open complete file

464 }
465
466 > function newToOldTextProviderOptions(options: TextSearchProviderOptions): TextSearchOptions[] { searchExtConversionTypes.ts
467 > return options.folderOptions.map(folderOption => ({
468 > folder: folderOption.folder,
469 > excludes: folderOption.excludes.map(e => typeof (e) === 'string' ? e : e.pattern),
470 > includes: folderOption.includes,
471 > useGlobalIgnoreFiles: folderOption.useIgnoreFiles.global,
472 > useIgnoreFiles: folderOption.useIgnoreFiles.local,
473 > useParentIgnoreFiles: folderOption.useIgnoreFiles.parent,
474 > followSymlinks: folderOption.followSymlinks,
475 > maxResults: options.maxResults,
476 > previewOptions: newToOldPreviewOptions(options.previewOptions),
477 > maxFileSize: options.maxFileSize,
478 > encoding: folderOption.encoding,
479 > afterContext: options.surroundingContext,
480 > beforeContext: options.surroundingContext
481 > } satisfies TextSearchOptions));
482 > }
483
484 export function newToOldPreviewOptions(options: {
485 > matchLines?: number; searchExtConversionTypes.ts
486 > charsPerLine?: number;
487 > } | undefined
488 > ): {
489 > matchLines: number;
490 > charsPerLine: number;
491 > } {
492 > return {
493 > matchLines: options?.matchLines ?? DEFAULT_TEXT_SEARCH_PREVIEW_OPTIONS.matchLines,
494 > charsPerLine: options?.charsPerLine ?? DEFAULT_TEXT_SEARCH_PREVIEW_OPTIONS.charsPerLine
495 > };
496 > }
497
498 export function oldToNewTextSearchResult(result: TextSearchResult): TextSearchResult2 {
513
514 provideTextSearchResults(query: TextSearchQuery2, options: TextSearchProviderOptions, progress: IProgress<TextSearchResult2>, token: CancellationToken): ProviderResult<TextSearchComplete2> {
516 > const progressShim = (oldResult: TextSearchResult) => {
517 if (!validateProviderResult(oldResult)) {
518 return;
520 progress.report(oldToNewTextSearchResult(oldResult));
521 };
523 > const getResult = async () => {
524 > return coalesce(await Promise.all(
525 > newToOldTextProviderOptions(options).map(
526 > o => this.provider.provideTextSearchResults(query, o, { report: (e) => progressShim(e) }, token))))
527 .reduce(
528 (prev, cur) => ({ limitHit: prev.limitHit || cur.limitHit }),
529 { limitHit: false }
530 );
532 > const oldResult = getResult();
533 > return oldResult.then((e) => {
534 return {
535 limitHit: e.limitHit,
536 message: coalesce(asArray(e.message))
537 } satisfies TextSearchComplete2;
539 > }
540 }
541
src/vs/workbench/api/common/extHostSearch.ts 19 introduced LOC · 4 ranges

Open complete file

67
68 registerTextSearchProviderOld(scheme: string, provider: vscode.TextSearchProvider): IDisposable {
69 > if (this._textSearchUsedSchemes.has(scheme)) { extHostSearch.ts
70 throw new Error(`a text search provider for the scheme '${scheme}' is already registered`);
71 }
73 > this._textSearchUsedSchemes.add(scheme);
74 > const handle = this._handlePool++;
75 > this._textSearchProvider.set(handle, new OldTextSearchProviderConverter(provider));
76 > this._proxy.$registerTextSearchProvider(handle, this._transformScheme(scheme));
77 > return toDisposable(() => {
78 > this._textSearchUsedSchemes.delete(scheme);
79 > this._textSearchProvider.delete(handle);
80 > this._proxy.$unregisterProvider(handle);
81 > });
82 > }
83
84 registerTextSearchProvider(scheme: string, provider: vscode.TextSearchProvider2): IDisposable {
169
170 $provideTextSearchResults(handle: number, session: number, rawQuery: IRawTextQuery, token: vscode.CancellationToken): Promise<ISearchCompleteStats> {
171 > const provider = this._textSearchProvider.get(handle); extHostSearch.ts
172 > if (!provider || !provider.provideTextSearchResults) {
173 throw new Error(`Unknown Text Search Provider ${handle}`);
174 }
176 > const query = reviveQuery(rawQuery);
177 > const engine = this.createTextSearchManager(query, provider);
178 > return engine.search(progress => this._proxy.$handleTextMatch(handle, session, progress), token);
179 > }
180
181 $provideAITextSearchResults(handle: number, session: number, rawQuery: IRawAITextQuery, token: vscode.CancellationToken): Promise<ISearchCompleteStats> {