diff --git a/packages/file-search/src/node/file-search-service-impl.spec.ts b/packages/file-search/src/node/file-search-service-impl.spec.ts index 074413ef88715..309a51e7153d0 100644 --- a/packages/file-search/src/node/file-search-service-impl.spec.ts +++ b/packages/file-search/src/node/file-search-service-impl.spec.ts @@ -89,16 +89,16 @@ describe('search-service', function () { expect(matches.length).to.eq(1); }); - it('should support file searches with globs without the prefixed or trailing star (*)', async () => { + it('should NOT support file searches with globs without the prefixed or trailing star (*)', async () => { const rootUri = FileUri.create(path.resolve(__dirname, '../../test-resources/subdir1/sub2')).toString(); const trailingMatches = await service.find('', { rootUris: [rootUri], includePatterns: ['*oo'] }); expect(trailingMatches).to.be.not.undefined; - expect(trailingMatches.length).to.eq(1); + expect(trailingMatches.length).to.eq(0); const prefixedMatches = await service.find('', { rootUris: [rootUri], includePatterns: ['oo*'] }); expect(prefixedMatches).to.be.not.undefined; - expect(prefixedMatches.length).to.eq(1); + expect(prefixedMatches.length).to.eq(0); }); }); diff --git a/packages/file-search/src/node/file-search-service-impl.ts b/packages/file-search/src/node/file-search-service-impl.ts index 72da3d32625b0..93d27a6439c37 100644 --- a/packages/file-search/src/node/file-search-service-impl.ts +++ b/packages/file-search/src/node/file-search-service-impl.ts @@ -110,14 +110,7 @@ export class FileSearchServiceImpl implements FileSearchService { const args = ['--files', '--case-sensitive']; if (options.includePatterns) { for (const includePattern of options.includePatterns) { - let includeGlob = includePattern; - if (!includeGlob.endsWith('*')) { - includeGlob = `${includeGlob}*`; - } - if (!includeGlob.startsWith('*')) { - includeGlob = `*${includeGlob}`; - } - args.push('--glob', includeGlob); + args.push('--glob', includePattern); } } if (!options.useGitIgnore) {