Skip to content

Commit 73db972

Browse files
committed
findTextInFiles - hook up includes/excludes
1 parent 0fb670f commit 73db972

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/vs/workbench/api/node/extHostWorkspace.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
66

7-
import { posix, relative } from 'path';
7+
import { posix, relative, join } from 'path';
88
import { delta as arrayDelta } from 'vs/base/common/arrays';
99
import { Emitter, Event } from 'vs/base/common/event';
1010
import { TernarySearchTree } from 'vs/base/common/map';
@@ -375,15 +375,22 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape {
375375

376376
const requestId = ExtHostWorkspace._requestIdPool++;
377377

378+
const globPatternToString = (pattern: vscode.GlobPattern | string) => {
379+
if (typeof pattern === 'string') {
380+
return pattern;
381+
}
382+
383+
return join(pattern.base, pattern.pattern);
384+
};
385+
378386
const queryOptions: IQueryOptions = {
379387
ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined,
380388
disregardIgnoreFiles: typeof options.useIgnoreFiles === 'boolean' ? !options.useIgnoreFiles : undefined,
381389
fileEncoding: options.encoding,
382390
maxResults: options.maxResults,
383391

384-
// TODO
385-
// includePattern: options.includes
386-
// excludePattern: options.excludes
392+
includePattern: options.includes && options.includes.map(include => globPatternToString(include)).join(', '),
393+
excludePattern: options.excludes && options.excludes.map(exclude => globPatternToString(exclude)).join(', ')
387394
};
388395

389396
this._activeSearchCallbacks[requestId] = p => {

0 commit comments

Comments
 (0)