|
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 | 'use strict'; |
6 | 6 |
|
7 | | -import { posix, relative } from 'path'; |
| 7 | +import { posix, relative, join } from 'path'; |
8 | 8 | import { delta as arrayDelta } from 'vs/base/common/arrays'; |
9 | 9 | import { Emitter, Event } from 'vs/base/common/event'; |
10 | 10 | import { TernarySearchTree } from 'vs/base/common/map'; |
@@ -375,15 +375,22 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape { |
375 | 375 |
|
376 | 376 | const requestId = ExtHostWorkspace._requestIdPool++; |
377 | 377 |
|
| 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 | + |
378 | 386 | const queryOptions: IQueryOptions = { |
379 | 387 | ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined, |
380 | 388 | disregardIgnoreFiles: typeof options.useIgnoreFiles === 'boolean' ? !options.useIgnoreFiles : undefined, |
381 | 389 | fileEncoding: options.encoding, |
382 | 390 | maxResults: options.maxResults, |
383 | 391 |
|
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(', ') |
387 | 394 | }; |
388 | 395 |
|
389 | 396 | this._activeSearchCallbacks[requestId] = p => { |
|
0 commit comments