@theia/file-search 1.45.1 → 1.46.0-next.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,31 +1,31 @@
1
- import { CancellationToken } from '@theia/core';
2
- export declare const fileSearchServicePath = "/services/search";
3
- /**
4
- * The JSON-RPC file search service interface.
5
- */
6
- export interface FileSearchService {
7
- /**
8
- * finds files by a given search pattern.
9
- * @return the matching file uris
10
- */
11
- find(searchPattern: string, options: FileSearchService.Options, cancellationToken?: CancellationToken): Promise<string[]>;
12
- }
13
- export declare const FileSearchService: unique symbol;
14
- export declare namespace FileSearchService {
15
- interface BaseOptions {
16
- useGitIgnore?: boolean;
17
- includePatterns?: string[];
18
- excludePatterns?: string[];
19
- }
20
- interface RootOptions {
21
- [rootUri: string]: BaseOptions;
22
- }
23
- interface Options extends BaseOptions {
24
- rootUris?: string[];
25
- rootOptions?: RootOptions;
26
- fuzzyMatch?: boolean;
27
- limit?: number;
28
- }
29
- }
30
- export declare const WHITESPACE_QUERY_SEPARATOR: RegExp;
1
+ import { CancellationToken } from '@theia/core';
2
+ export declare const fileSearchServicePath = "/services/search";
3
+ /**
4
+ * The JSON-RPC file search service interface.
5
+ */
6
+ export interface FileSearchService {
7
+ /**
8
+ * finds files by a given search pattern.
9
+ * @return the matching file uris
10
+ */
11
+ find(searchPattern: string, options: FileSearchService.Options, cancellationToken?: CancellationToken): Promise<string[]>;
12
+ }
13
+ export declare const FileSearchService: unique symbol;
14
+ export declare namespace FileSearchService {
15
+ interface BaseOptions {
16
+ useGitIgnore?: boolean;
17
+ includePatterns?: string[];
18
+ excludePatterns?: string[];
19
+ }
20
+ interface RootOptions {
21
+ [rootUri: string]: BaseOptions;
22
+ }
23
+ interface Options extends BaseOptions {
24
+ rootUris?: string[];
25
+ rootOptions?: RootOptions;
26
+ fuzzyMatch?: boolean;
27
+ limit?: number;
28
+ }
29
+ }
30
+ export declare const WHITESPACE_QUERY_SEPARATOR: RegExp;
31
31
  //# sourceMappingURL=file-search-service.d.ts.map
@@ -1,22 +1,22 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.WHITESPACE_QUERY_SEPARATOR = exports.FileSearchService = exports.fileSearchServicePath = void 0;
19
- exports.fileSearchServicePath = '/services/search';
20
- exports.FileSearchService = Symbol('FileSearchService');
21
- exports.WHITESPACE_QUERY_SEPARATOR = /\s+/;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.WHITESPACE_QUERY_SEPARATOR = exports.FileSearchService = exports.fileSearchServicePath = void 0;
19
+ exports.fileSearchServicePath = '/services/search';
20
+ exports.FileSearchService = Symbol('FileSearchService');
21
+ exports.WHITESPACE_QUERY_SEPARATOR = /\s+/;
22
22
  //# sourceMappingURL=file-search-service.js.map
@@ -1,4 +1,4 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
4
  //# sourceMappingURL=file-search-backend-module.d.ts.map
@@ -1,26 +1,26 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const common_1 = require("@theia/core/lib/common");
20
- const file_search_service_impl_1 = require("./file-search-service-impl");
21
- const file_search_service_1 = require("../common/file-search-service");
22
- exports.default = new inversify_1.ContainerModule(bind => {
23
- bind(file_search_service_1.FileSearchService).to(file_search_service_impl_1.FileSearchServiceImpl).inSingletonScope();
24
- bind(common_1.ConnectionHandler).toDynamicValue(ctx => new common_1.RpcConnectionHandler(file_search_service_1.fileSearchServicePath, () => ctx.container.get(file_search_service_1.FileSearchService))).inSingletonScope();
25
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const inversify_1 = require("@theia/core/shared/inversify");
19
+ const common_1 = require("@theia/core/lib/common");
20
+ const file_search_service_impl_1 = require("./file-search-service-impl");
21
+ const file_search_service_1 = require("../common/file-search-service");
22
+ exports.default = new inversify_1.ContainerModule(bind => {
23
+ bind(file_search_service_1.FileSearchService).to(file_search_service_impl_1.FileSearchServiceImpl).inSingletonScope();
24
+ bind(common_1.ConnectionHandler).toDynamicValue(ctx => new common_1.RpcConnectionHandler(file_search_service_1.fileSearchServicePath, () => ctx.container.get(file_search_service_1.FileSearchService))).inSingletonScope();
25
+ });
26
26
  //# sourceMappingURL=file-search-backend-module.js.map
@@ -1,16 +1,16 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- import { CancellationToken, ILogger } from '@theia/core';
3
- import { RawProcessFactory } from '@theia/process/lib/node';
4
- import { FileSearchService } from '../common/file-search-service';
5
- export declare class FileSearchServiceImpl implements FileSearchService {
6
- protected readonly logger: ILogger;
7
- /** @deprecated since 1.7.0 */
8
- protected readonly rawProcessFactory: RawProcessFactory;
9
- constructor(logger: ILogger,
10
- /** @deprecated since 1.7.0 */
11
- rawProcessFactory: RawProcessFactory);
12
- find(searchPattern: string, options: FileSearchService.Options, clientToken?: CancellationToken): Promise<string[]>;
13
- protected doFind(rootUri: URI, options: FileSearchService.BaseOptions, accept: (fileUri: string) => void, token: CancellationToken): Promise<void>;
14
- protected getSearchArgs(options: FileSearchService.BaseOptions): string[];
15
- }
1
+ import URI from '@theia/core/lib/common/uri';
2
+ import { CancellationToken, ILogger } from '@theia/core';
3
+ import { RawProcessFactory } from '@theia/process/lib/node';
4
+ import { FileSearchService } from '../common/file-search-service';
5
+ export declare class FileSearchServiceImpl implements FileSearchService {
6
+ protected readonly logger: ILogger;
7
+ /** @deprecated since 1.7.0 */
8
+ protected readonly rawProcessFactory: RawProcessFactory;
9
+ constructor(logger: ILogger,
10
+ /** @deprecated since 1.7.0 */
11
+ rawProcessFactory: RawProcessFactory);
12
+ find(searchPattern: string, options: FileSearchService.Options, clientToken?: CancellationToken): Promise<string[]>;
13
+ protected doFind(rootUri: URI, options: FileSearchService.BaseOptions, accept: (fileUri: string) => void, token: CancellationToken): Promise<void>;
14
+ protected getSearchArgs(options: FileSearchService.BaseOptions): string[];
15
+ }
16
16
  //# sourceMappingURL=file-search-service-impl.d.ts.map
@@ -1,197 +1,197 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- var __param = (this && this.__param) || function (paramIndex, decorator) {
27
- return function (target, key) { decorator(target, key, paramIndex); }
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.FileSearchServiceImpl = void 0;
31
- const cp = require("child_process");
32
- const fuzzy = require("@theia/core/shared/fuzzy");
33
- const readline = require("readline");
34
- const ripgrep_1 = require("@vscode/ripgrep");
35
- const inversify_1 = require("@theia/core/shared/inversify");
36
- const uri_1 = require("@theia/core/lib/common/uri");
37
- const file_uri_1 = require("@theia/core/lib/node/file-uri");
38
- const core_1 = require("@theia/core");
39
- const node_1 = require("@theia/process/lib/node");
40
- const file_search_service_1 = require("../common/file-search-service");
41
- const path = require("path");
42
- let FileSearchServiceImpl = class FileSearchServiceImpl {
43
- constructor(logger,
44
- /** @deprecated since 1.7.0 */
45
- rawProcessFactory) {
46
- this.logger = logger;
47
- this.rawProcessFactory = rawProcessFactory;
48
- }
49
- async find(searchPattern, options, clientToken) {
50
- const cancellationSource = new core_1.CancellationTokenSource();
51
- if (clientToken) {
52
- clientToken.onCancellationRequested(() => cancellationSource.cancel());
53
- }
54
- const token = cancellationSource.token;
55
- const opts = {
56
- fuzzyMatch: true,
57
- limit: Number.MAX_SAFE_INTEGER,
58
- useGitIgnore: true,
59
- ...options
60
- };
61
- const roots = options.rootOptions || {};
62
- if (options.rootUris) {
63
- for (const rootUri of options.rootUris) {
64
- if (!roots[rootUri]) {
65
- roots[rootUri] = {};
66
- }
67
- }
68
- }
69
- // eslint-disable-next-line guard-for-in
70
- for (const rootUri in roots) {
71
- const rootOptions = roots[rootUri];
72
- if (opts.includePatterns) {
73
- const includePatterns = rootOptions.includePatterns || [];
74
- rootOptions.includePatterns = [...includePatterns, ...opts.includePatterns];
75
- }
76
- if (opts.excludePatterns) {
77
- const excludePatterns = rootOptions.excludePatterns || [];
78
- rootOptions.excludePatterns = [...excludePatterns, ...opts.excludePatterns];
79
- }
80
- if (rootOptions.useGitIgnore === undefined) {
81
- rootOptions.useGitIgnore = opts.useGitIgnore;
82
- }
83
- }
84
- const exactMatches = new Set();
85
- const fuzzyMatches = new Set();
86
- if (core_1.isWindows) {
87
- // Allow users on Windows to search for paths using either forwards or backwards slash
88
- searchPattern = searchPattern.replace(/\//g, '\\');
89
- }
90
- const patterns = searchPattern.toLocaleLowerCase().trim().split(file_search_service_1.WHITESPACE_QUERY_SEPARATOR);
91
- await Promise.all(Object.keys(roots).map(async (root) => {
92
- try {
93
- const rootUri = new uri_1.default(root);
94
- const rootPath = file_uri_1.FileUri.fsPath(rootUri);
95
- const rootOptions = roots[root];
96
- await this.doFind(rootUri, rootOptions, candidate => {
97
- // Convert OS-native candidate path to a file URI string
98
- const fileUri = file_uri_1.FileUri.create(path.resolve(rootPath, candidate)).toString();
99
- // Skip results that have already been matched.
100
- if (exactMatches.has(fileUri) || fuzzyMatches.has(fileUri)) {
101
- return;
102
- }
103
- // Determine if the candidate matches any of the patterns exactly or fuzzy
104
- const candidatePattern = candidate.toLocaleLowerCase();
105
- const patternExists = patterns.every(pattern => candidatePattern.indexOf(pattern) !== -1);
106
- if (patternExists) {
107
- exactMatches.add(fileUri);
108
- }
109
- else if (!searchPattern || searchPattern === '*') {
110
- exactMatches.add(fileUri);
111
- }
112
- else {
113
- const fuzzyPatternExists = patterns.every(pattern => fuzzy.test(pattern, candidate));
114
- if (opts.fuzzyMatch && fuzzyPatternExists) {
115
- fuzzyMatches.add(fileUri);
116
- }
117
- }
118
- // Preemptively terminate the search when the list of exact matches reaches the limit.
119
- if (exactMatches.size === opts.limit) {
120
- cancellationSource.cancel();
121
- }
122
- }, token);
123
- }
124
- catch (e) {
125
- console.error('Failed to search:', root, e);
126
- }
127
- }));
128
- if (clientToken && clientToken.isCancellationRequested) {
129
- return [];
130
- }
131
- // Return the list of results limited by the search limit.
132
- return [...exactMatches, ...fuzzyMatches].slice(0, opts.limit);
133
- }
134
- doFind(rootUri, options, accept, token) {
135
- return new Promise((resolve, reject) => {
136
- const cwd = file_uri_1.FileUri.fsPath(rootUri);
137
- const args = this.getSearchArgs(options);
138
- const ripgrep = cp.spawn(ripgrep_1.rgPath, args, { cwd });
139
- ripgrep.on('error', reject);
140
- ripgrep.on('exit', (code, signal) => {
141
- if (typeof code === 'number' && code !== 0) {
142
- reject(new Error(`"${ripgrep_1.rgPath}" exited with code: ${code}`));
143
- }
144
- else if (typeof signal === 'string') {
145
- reject(new Error(`"${ripgrep_1.rgPath}" was terminated by signal: ${signal}`));
146
- }
147
- });
148
- token.onCancellationRequested(() => {
149
- ripgrep.kill(); // most likely sends a signal.
150
- resolve(); // avoid rejecting for no good reason.
151
- });
152
- const lineReader = readline.createInterface({
153
- input: ripgrep.stdout,
154
- crlfDelay: Infinity,
155
- });
156
- lineReader.on('line', line => {
157
- if (!token.isCancellationRequested) {
158
- accept(line);
159
- }
160
- });
161
- lineReader.on('close', () => resolve());
162
- });
163
- }
164
- getSearchArgs(options) {
165
- const args = ['--files', '--hidden', '--case-sensitive', '--no-require-git', '--no-config'];
166
- if (options.includePatterns) {
167
- for (const includePattern of options.includePatterns) {
168
- if (includePattern) {
169
- args.push('--glob', includePattern);
170
- }
171
- }
172
- }
173
- if (options.excludePatterns) {
174
- for (const excludePattern of options.excludePatterns) {
175
- if (excludePattern) {
176
- args.push('--glob', `!${excludePattern}`);
177
- }
178
- }
179
- }
180
- if (options.useGitIgnore) {
181
- // ripgrep follows `.gitignore` by default, but it doesn't exclude `.git`:
182
- args.push('--glob', '!.git');
183
- }
184
- else {
185
- args.push('--no-ignore');
186
- }
187
- return args;
188
- }
189
- };
190
- FileSearchServiceImpl = __decorate([
191
- (0, inversify_1.injectable)(),
192
- __param(0, (0, inversify_1.inject)(core_1.ILogger)),
193
- __param(1, (0, inversify_1.inject)(node_1.RawProcessFactory)),
194
- __metadata("design:paramtypes", [Object, Function])
195
- ], FileSearchServiceImpl);
196
- exports.FileSearchServiceImpl = FileSearchServiceImpl;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
27
+ return function (target, key) { decorator(target, key, paramIndex); }
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.FileSearchServiceImpl = void 0;
31
+ const cp = require("child_process");
32
+ const fuzzy = require("@theia/core/shared/fuzzy");
33
+ const readline = require("readline");
34
+ const ripgrep_1 = require("@vscode/ripgrep");
35
+ const inversify_1 = require("@theia/core/shared/inversify");
36
+ const uri_1 = require("@theia/core/lib/common/uri");
37
+ const file_uri_1 = require("@theia/core/lib/common/file-uri");
38
+ const core_1 = require("@theia/core");
39
+ const node_1 = require("@theia/process/lib/node");
40
+ const file_search_service_1 = require("../common/file-search-service");
41
+ const path = require("path");
42
+ let FileSearchServiceImpl = class FileSearchServiceImpl {
43
+ constructor(logger,
44
+ /** @deprecated since 1.7.0 */
45
+ rawProcessFactory) {
46
+ this.logger = logger;
47
+ this.rawProcessFactory = rawProcessFactory;
48
+ }
49
+ async find(searchPattern, options, clientToken) {
50
+ const cancellationSource = new core_1.CancellationTokenSource();
51
+ if (clientToken) {
52
+ clientToken.onCancellationRequested(() => cancellationSource.cancel());
53
+ }
54
+ const token = cancellationSource.token;
55
+ const opts = {
56
+ fuzzyMatch: true,
57
+ limit: Number.MAX_SAFE_INTEGER,
58
+ useGitIgnore: true,
59
+ ...options
60
+ };
61
+ const roots = options.rootOptions || {};
62
+ if (options.rootUris) {
63
+ for (const rootUri of options.rootUris) {
64
+ if (!roots[rootUri]) {
65
+ roots[rootUri] = {};
66
+ }
67
+ }
68
+ }
69
+ // eslint-disable-next-line guard-for-in
70
+ for (const rootUri in roots) {
71
+ const rootOptions = roots[rootUri];
72
+ if (opts.includePatterns) {
73
+ const includePatterns = rootOptions.includePatterns || [];
74
+ rootOptions.includePatterns = [...includePatterns, ...opts.includePatterns];
75
+ }
76
+ if (opts.excludePatterns) {
77
+ const excludePatterns = rootOptions.excludePatterns || [];
78
+ rootOptions.excludePatterns = [...excludePatterns, ...opts.excludePatterns];
79
+ }
80
+ if (rootOptions.useGitIgnore === undefined) {
81
+ rootOptions.useGitIgnore = opts.useGitIgnore;
82
+ }
83
+ }
84
+ const exactMatches = new Set();
85
+ const fuzzyMatches = new Set();
86
+ if (core_1.isWindows) {
87
+ // Allow users on Windows to search for paths using either forwards or backwards slash
88
+ searchPattern = searchPattern.replace(/\//g, '\\');
89
+ }
90
+ const patterns = searchPattern.toLocaleLowerCase().trim().split(file_search_service_1.WHITESPACE_QUERY_SEPARATOR);
91
+ await Promise.all(Object.keys(roots).map(async (root) => {
92
+ try {
93
+ const rootUri = new uri_1.default(root);
94
+ const rootPath = file_uri_1.FileUri.fsPath(rootUri);
95
+ const rootOptions = roots[root];
96
+ await this.doFind(rootUri, rootOptions, candidate => {
97
+ // Convert OS-native candidate path to a file URI string
98
+ const fileUri = file_uri_1.FileUri.create(path.resolve(rootPath, candidate)).toString();
99
+ // Skip results that have already been matched.
100
+ if (exactMatches.has(fileUri) || fuzzyMatches.has(fileUri)) {
101
+ return;
102
+ }
103
+ // Determine if the candidate matches any of the patterns exactly or fuzzy
104
+ const candidatePattern = candidate.toLocaleLowerCase();
105
+ const patternExists = patterns.every(pattern => candidatePattern.indexOf(pattern) !== -1);
106
+ if (patternExists) {
107
+ exactMatches.add(fileUri);
108
+ }
109
+ else if (!searchPattern || searchPattern === '*') {
110
+ exactMatches.add(fileUri);
111
+ }
112
+ else {
113
+ const fuzzyPatternExists = patterns.every(pattern => fuzzy.test(pattern, candidate));
114
+ if (opts.fuzzyMatch && fuzzyPatternExists) {
115
+ fuzzyMatches.add(fileUri);
116
+ }
117
+ }
118
+ // Preemptively terminate the search when the list of exact matches reaches the limit.
119
+ if (exactMatches.size === opts.limit) {
120
+ cancellationSource.cancel();
121
+ }
122
+ }, token);
123
+ }
124
+ catch (e) {
125
+ console.error('Failed to search:', root, e);
126
+ }
127
+ }));
128
+ if (clientToken && clientToken.isCancellationRequested) {
129
+ return [];
130
+ }
131
+ // Return the list of results limited by the search limit.
132
+ return [...exactMatches, ...fuzzyMatches].slice(0, opts.limit);
133
+ }
134
+ doFind(rootUri, options, accept, token) {
135
+ return new Promise((resolve, reject) => {
136
+ const cwd = file_uri_1.FileUri.fsPath(rootUri);
137
+ const args = this.getSearchArgs(options);
138
+ const ripgrep = cp.spawn(ripgrep_1.rgPath, args, { cwd });
139
+ ripgrep.on('error', reject);
140
+ ripgrep.on('exit', (code, signal) => {
141
+ if (typeof code === 'number' && code !== 0) {
142
+ reject(new Error(`"${ripgrep_1.rgPath}" exited with code: ${code}`));
143
+ }
144
+ else if (typeof signal === 'string') {
145
+ reject(new Error(`"${ripgrep_1.rgPath}" was terminated by signal: ${signal}`));
146
+ }
147
+ });
148
+ token.onCancellationRequested(() => {
149
+ ripgrep.kill(); // most likely sends a signal.
150
+ resolve(); // avoid rejecting for no good reason.
151
+ });
152
+ const lineReader = readline.createInterface({
153
+ input: ripgrep.stdout,
154
+ crlfDelay: Infinity,
155
+ });
156
+ lineReader.on('line', line => {
157
+ if (!token.isCancellationRequested) {
158
+ accept(line);
159
+ }
160
+ });
161
+ lineReader.on('close', () => resolve());
162
+ });
163
+ }
164
+ getSearchArgs(options) {
165
+ const args = ['--files', '--hidden', '--case-sensitive', '--no-require-git', '--no-config'];
166
+ if (options.includePatterns) {
167
+ for (const includePattern of options.includePatterns) {
168
+ if (includePattern) {
169
+ args.push('--glob', includePattern);
170
+ }
171
+ }
172
+ }
173
+ if (options.excludePatterns) {
174
+ for (const excludePattern of options.excludePatterns) {
175
+ if (excludePattern) {
176
+ args.push('--glob', `!${excludePattern}`);
177
+ }
178
+ }
179
+ }
180
+ if (options.useGitIgnore) {
181
+ // ripgrep follows `.gitignore` by default, but it doesn't exclude `.git`:
182
+ args.push('--glob', '!.git');
183
+ }
184
+ else {
185
+ args.push('--no-ignore');
186
+ }
187
+ return args;
188
+ }
189
+ };
190
+ FileSearchServiceImpl = __decorate([
191
+ (0, inversify_1.injectable)(),
192
+ __param(0, (0, inversify_1.inject)(core_1.ILogger)),
193
+ __param(1, (0, inversify_1.inject)(node_1.RawProcessFactory)),
194
+ __metadata("design:paramtypes", [Object, Function])
195
+ ], FileSearchServiceImpl);
196
+ exports.FileSearchServiceImpl = FileSearchServiceImpl;
197
197
  //# sourceMappingURL=file-search-service-impl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-search-service-impl.js","sourceRoot":"","sources":["../../src/node/file-search-service-impl.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8E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AAA,sBAAU,GAAE;IAIJ,WAAA,IAAA,kBAAM,EAAC,cAAO,CAAC,CAAA;IAEf,WAAA,IAAA,kBAAM,EAAC,wBAAiB,CAAC,CAAA;;GALrB,qBAAqB,CA6JjC;AA7JY,sDAAqB"}
1
+ {"version":3,"file":"file-search-service-impl.js","sourceRoot":"","sources":["../../src/node/file-search-service-impl.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;;;;;;;AAEhF,oCAAoC;AACpC,kDAAkD;AAClD,qCAAqC;AACrC,6CAAyC;AACzC,4DAAkE;AAClE,oDAA6C;AAC7C,8DAA0D;AAC1D,sCAA6F;AAC7F,kDAA4D;AAC5D,uEAA8F;AAC9F,6BAA6B;AAG7B,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAE9B,YACwC,MAAe;IACnD,8BAA8B;IACgB,iBAAoC;QAF9C,WAAM,GAAN,MAAM,CAAS;QAEL,sBAAiB,GAAjB,iBAAiB,CAAmB;IAClF,CAAC;IAEL,KAAK,CAAC,IAAI,CAAC,aAAqB,EAAE,OAAkC,EAAE,WAA+B;QACjG,MAAM,kBAAkB,GAAG,IAAI,8BAAuB,EAAE,CAAC;QACzD,IAAI,WAAW,EAAE;YACb,WAAW,CAAC,uBAAuB,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1E;QACD,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC;QACvC,MAAM,IAAI,GAAG;YACT,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,MAAM,CAAC,gBAAgB;YAC9B,YAAY,EAAE,IAAI;YAClB,GAAG,OAAO;SACb,CAA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