@theia/file-search 1.67.0-next.3 → 1.67.0-next.56
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.
- package/README.md +1 -1
- package/package.json +7 -7
- package/lib/browser/file-search-frontend-module.d.ts +0 -4
- package/lib/browser/file-search-frontend-module.d.ts.map +0 -1
- package/lib/browser/file-search-frontend-module.js +0 -36
- package/lib/browser/file-search-frontend-module.js.map +0 -1
- package/lib/browser/quick-file-open-contribution.d.ts +0 -11
- package/lib/browser/quick-file-open-contribution.d.ts.map +0 -1
- package/lib/browser/quick-file-open-contribution.js +0 -68
- package/lib/browser/quick-file-open-contribution.js.map +0 -1
- package/lib/browser/quick-file-open.d.ts +0 -67
- package/lib/browser/quick-file-open.d.ts.map +0 -1
- package/lib/browser/quick-file-open.js +0 -214
- package/lib/browser/quick-file-open.js.map +0 -1
- package/lib/browser/quick-file-select-service.d.ts +0 -57
- package/lib/browser/quick-file-select-service.d.ts.map +0 -1
- package/lib/browser/quick-file-select-service.js +0 -276
- package/lib/browser/quick-file-select-service.js.map +0 -1
- package/lib/browser-only/file-search-frontend-only-module.d.ts +0 -4
- package/lib/browser-only/file-search-frontend-only-module.d.ts.map +0 -1
- package/lib/browser-only/file-search-frontend-only-module.js +0 -34
- package/lib/browser-only/file-search-frontend-only-module.js.map +0 -1
- package/lib/browser-only/file-search-service-impl.d.ts +0 -38
- package/lib/browser-only/file-search-service-impl.d.ts.map +0 -1
- package/lib/browser-only/file-search-service-impl.js +0 -211
- package/lib/browser-only/file-search-service-impl.js.map +0 -1
- package/lib/common/file-search-service.d.ts +0 -31
- package/lib/common/file-search-service.d.ts.map +0 -1
- package/lib/common/file-search-service.js +0 -22
- package/lib/common/file-search-service.js.map +0 -1
- package/lib/node/file-search-backend-module.d.ts +0 -4
- package/lib/node/file-search-backend-module.d.ts.map +0 -1
- package/lib/node/file-search-backend-module.js +0 -26
- package/lib/node/file-search-backend-module.js.map +0 -1
- package/lib/node/file-search-service-impl.d.ts +0 -16
- package/lib/node/file-search-service-impl.d.ts.map +0 -1
- package/lib/node/file-search-service-impl.js +0 -184
- package/lib/node/file-search-service-impl.js.map +0 -1
- package/lib/node/file-search-service-impl.spec.d.ts +0 -2
- package/lib/node/file-search-service-impl.spec.d.ts.map +0 -1
- package/lib/node/file-search-service-impl.spec.js +0 -196
- package/lib/node/file-search-service-impl.spec.js.map +0 -1
|
@@ -1,276 +0,0 @@
|
|
|
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 QuickFileSelectService_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.QuickFileSelectService = exports.FileQuickPickItem = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
-
const label_provider_1 = require("@theia/core/lib/browser/label-provider");
|
|
23
|
-
const quick_input_service_1 = require("@theia/core/lib/browser/quick-input/quick-input-service");
|
|
24
|
-
const common_1 = require("@theia/core/lib/common");
|
|
25
|
-
const message_service_1 = require("@theia/core/lib/common/message-service");
|
|
26
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
27
|
-
const fuzzy = require("@theia/core/shared/fuzzy");
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const browser_2 = require("@theia/editor/lib/browser");
|
|
30
|
-
const navigation_location_service_1 = require("@theia/editor/lib/browser/navigation/navigation-location-service");
|
|
31
|
-
const common_2 = require("@theia/filesystem/lib/common");
|
|
32
|
-
const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
|
|
33
|
-
const file_search_service_1 = require("../common/file-search-service");
|
|
34
|
-
// Supports patterns of <path><#|:><line><#|:|,><col?>
|
|
35
|
-
const LINE_COLON_PATTERN = /\s?[#:\(](?:line )?(\d*)(?:[#:,](\d*))?\)?\s*$/;
|
|
36
|
-
var FileQuickPickItem;
|
|
37
|
-
(function (FileQuickPickItem) {
|
|
38
|
-
function is(obj) {
|
|
39
|
-
return obj && 'uri' in obj;
|
|
40
|
-
}
|
|
41
|
-
FileQuickPickItem.is = is;
|
|
42
|
-
})(FileQuickPickItem || (exports.FileQuickPickItem = FileQuickPickItem = {}));
|
|
43
|
-
let QuickFileSelectService = QuickFileSelectService_1 = class QuickFileSelectService {
|
|
44
|
-
async getPicks(fileFilter = '', token = common_1.CancellationToken.None, options = {
|
|
45
|
-
hideIgnoredFiles: true
|
|
46
|
-
}) {
|
|
47
|
-
const roots = this.workspaceService.tryGetRoots();
|
|
48
|
-
const alreadyCollected = new Set();
|
|
49
|
-
const recentlyUsedItems = [];
|
|
50
|
-
if (this.preferences.get('search.quickOpen.includeHistory')) {
|
|
51
|
-
const locations = [...this.navigationLocationService.locations()].reverse();
|
|
52
|
-
for (const location of locations) {
|
|
53
|
-
const uriString = location.uri.toString();
|
|
54
|
-
if (location.uri.scheme === 'file' && !alreadyCollected.has(uriString) && fuzzy.test(fileFilter, uriString)) {
|
|
55
|
-
if (recentlyUsedItems.length === 0) {
|
|
56
|
-
recentlyUsedItems.push({
|
|
57
|
-
type: 'separator',
|
|
58
|
-
label: common_1.nls.localizeByDefault('recently opened')
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const item = this.toItem(fileFilter, location.uri, options.onSelect);
|
|
62
|
-
recentlyUsedItems.push(item);
|
|
63
|
-
alreadyCollected.add(uriString);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (fileFilter.length > 0) {
|
|
68
|
-
const handler = async (results) => {
|
|
69
|
-
if (token.isCancellationRequested || results.length <= 0) {
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
const result = [...recentlyUsedItems];
|
|
73
|
-
const fileSearchResultItems = [];
|
|
74
|
-
for (const fileUri of results) {
|
|
75
|
-
if (!alreadyCollected.has(fileUri)) {
|
|
76
|
-
const item = this.toItem(fileFilter, fileUri, options.onSelect);
|
|
77
|
-
fileSearchResultItems.push(item);
|
|
78
|
-
alreadyCollected.add(fileUri);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// Create a copy of the file search results and sort.
|
|
82
|
-
const sortedResults = fileSearchResultItems.slice();
|
|
83
|
-
sortedResults.sort((a, b) => this.compareItems(a, b, fileFilter));
|
|
84
|
-
if (sortedResults.length > 0) {
|
|
85
|
-
result.push({
|
|
86
|
-
type: 'separator',
|
|
87
|
-
label: common_1.nls.localizeByDefault('file results')
|
|
88
|
-
});
|
|
89
|
-
result.push(...sortedResults);
|
|
90
|
-
}
|
|
91
|
-
// Return the recently used items, followed by the search results.
|
|
92
|
-
return result;
|
|
93
|
-
};
|
|
94
|
-
return this.fileSearchService.find(fileFilter, {
|
|
95
|
-
rootUris: roots.map(r => r.resource.toString()),
|
|
96
|
-
fuzzyMatch: true,
|
|
97
|
-
limit: 200,
|
|
98
|
-
useGitIgnore: options.hideIgnoredFiles,
|
|
99
|
-
excludePatterns: options.hideIgnoredFiles
|
|
100
|
-
? Object.keys(this.fsPreferences['files.exclude'])
|
|
101
|
-
: undefined,
|
|
102
|
-
}, token).then(handler);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
return roots.length !== 0 ? recentlyUsedItems : [];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
compareItems(left, right, fileFilter) {
|
|
109
|
-
/**
|
|
110
|
-
* Score a given string.
|
|
111
|
-
*
|
|
112
|
-
* @param str the string to score on.
|
|
113
|
-
* @returns the score.
|
|
114
|
-
*/
|
|
115
|
-
function score(str) {
|
|
116
|
-
var _a;
|
|
117
|
-
if (!str) {
|
|
118
|
-
return 0;
|
|
119
|
-
}
|
|
120
|
-
let exactMatch = true;
|
|
121
|
-
const partialMatches = querySplit.reduce((matched, part) => {
|
|
122
|
-
const partMatches = str.includes(part);
|
|
123
|
-
exactMatch = exactMatch && partMatches;
|
|
124
|
-
return partMatches ? matched + QuickFileSelectService_1.Scores.partial : matched;
|
|
125
|
-
}, 0);
|
|
126
|
-
// Check fuzzy matches.
|
|
127
|
-
const fuzzyMatch = (_a = fuzzy.match(queryJoin, str)) !== null && _a !== void 0 ? _a : { score: 0 };
|
|
128
|
-
if (fuzzyMatch.score === Infinity && exactMatch) {
|
|
129
|
-
return Number.MAX_SAFE_INTEGER;
|
|
130
|
-
}
|
|
131
|
-
return fuzzyMatch.score + partialMatches + (exactMatch ? QuickFileSelectService_1.Scores.exact : 0);
|
|
132
|
-
}
|
|
133
|
-
const query = normalize(fileFilter);
|
|
134
|
-
// Adjust for whitespaces in the query.
|
|
135
|
-
const querySplit = query.split(file_search_service_1.WHITESPACE_QUERY_SEPARATOR);
|
|
136
|
-
const queryJoin = querySplit.join('');
|
|
137
|
-
const compareByLabelScore = (l, r) => score(r.label) - score(l.label);
|
|
138
|
-
const compareByLabelIndex = (l, r) => r.label.indexOf(query) - l.label.indexOf(query);
|
|
139
|
-
const compareByLabel = (l, r) => l.label.localeCompare(r.label);
|
|
140
|
-
const compareByPathScore = (l, r) => score(r.uri.path.toString()) - score(l.uri.path.toString());
|
|
141
|
-
const compareByPathIndex = (l, r) => r.uri.path.toString().indexOf(query) - l.uri.path.toString().indexOf(query);
|
|
142
|
-
const compareByPathLabel = (l, r) => l.uri.path.toString().localeCompare(r.uri.path.toString());
|
|
143
|
-
return compareWithDiscriminators(left, right, compareByLabelScore, compareByLabelIndex, compareByLabel, compareByPathScore, compareByPathIndex, compareByPathLabel);
|
|
144
|
-
}
|
|
145
|
-
toItem(lookFor, uriOrString, onSelect) {
|
|
146
|
-
const uri = uriOrString instanceof uri_1.default ? uriOrString : new uri_1.default(uriOrString);
|
|
147
|
-
const label = this.labelProvider.getName(uri);
|
|
148
|
-
const description = this.getItemDescription(uri);
|
|
149
|
-
const iconClasses = this.getItemIconClasses(uri);
|
|
150
|
-
const item = {
|
|
151
|
-
label,
|
|
152
|
-
description,
|
|
153
|
-
highlights: {
|
|
154
|
-
label: (0, quick_input_service_1.findMatches)(label, lookFor),
|
|
155
|
-
description: (0, quick_input_service_1.findMatches)(description, lookFor)
|
|
156
|
-
},
|
|
157
|
-
iconClasses,
|
|
158
|
-
uri
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
...item,
|
|
162
|
-
execute: () => onSelect ? onSelect(item) : undefined
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
getItemIconClasses(uri) {
|
|
166
|
-
const icon = this.labelProvider.getIcon(uri).split(' ').filter(v => v.length > 0);
|
|
167
|
-
if (icon.length > 0) {
|
|
168
|
-
icon.push('file-icon');
|
|
169
|
-
}
|
|
170
|
-
return icon;
|
|
171
|
-
}
|
|
172
|
-
getItemDescription(uri) {
|
|
173
|
-
return this.labelProvider.getDetails(uri);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Splits the given expression into a structure of search-file-filter and
|
|
177
|
-
* location-range.
|
|
178
|
-
*
|
|
179
|
-
* @param expression patterns of <path><#|:><line><#|:|,><col?>
|
|
180
|
-
*/
|
|
181
|
-
splitFilterAndRange(expression) {
|
|
182
|
-
var _a, _b;
|
|
183
|
-
let filter = expression;
|
|
184
|
-
let range = undefined;
|
|
185
|
-
// Find line and column number from the expression using RegExp.
|
|
186
|
-
const patternMatch = LINE_COLON_PATTERN.exec(expression);
|
|
187
|
-
if (patternMatch) {
|
|
188
|
-
const line = parseInt((_a = patternMatch[1]) !== null && _a !== void 0 ? _a : '', 10);
|
|
189
|
-
if (Number.isFinite(line)) {
|
|
190
|
-
const lineNumber = line > 0 ? line - 1 : 0;
|
|
191
|
-
const column = parseInt((_b = patternMatch[2]) !== null && _b !== void 0 ? _b : '', 10);
|
|
192
|
-
const startColumn = Number.isFinite(column) && column > 0 ? column - 1 : 0;
|
|
193
|
-
const position = browser_2.Position.create(lineNumber, startColumn);
|
|
194
|
-
filter = expression.substring(0, patternMatch.index);
|
|
195
|
-
range = browser_2.Range.create(position, position);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return { filter, range };
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
exports.QuickFileSelectService = QuickFileSelectService;
|
|
202
|
-
/**
|
|
203
|
-
* The score constants when comparing file search results.
|
|
204
|
-
*/
|
|
205
|
-
QuickFileSelectService.Scores = {
|
|
206
|
-
max: 1000, // represents the maximum score from fuzzy matching (Infinity).
|
|
207
|
-
exact: 500, // represents the score assigned to exact matching.
|
|
208
|
-
partial: 250 // represents the score assigned to partial matching.
|
|
209
|
-
};
|
|
210
|
-
tslib_1.__decorate([
|
|
211
|
-
(0, inversify_1.inject)(browser_1.KeybindingRegistry),
|
|
212
|
-
tslib_1.__metadata("design:type", browser_1.KeybindingRegistry)
|
|
213
|
-
], QuickFileSelectService.prototype, "keybindingRegistry", void 0);
|
|
214
|
-
tslib_1.__decorate([
|
|
215
|
-
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
216
|
-
tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
217
|
-
], QuickFileSelectService.prototype, "workspaceService", void 0);
|
|
218
|
-
tslib_1.__decorate([
|
|
219
|
-
(0, inversify_1.inject)(browser_1.OpenerService),
|
|
220
|
-
tslib_1.__metadata("design:type", Object)
|
|
221
|
-
], QuickFileSelectService.prototype, "openerService", void 0);
|
|
222
|
-
tslib_1.__decorate([
|
|
223
|
-
(0, inversify_1.inject)(quick_input_service_1.QuickInputService),
|
|
224
|
-
(0, inversify_1.optional)(),
|
|
225
|
-
tslib_1.__metadata("design:type", Object)
|
|
226
|
-
], QuickFileSelectService.prototype, "quickInputService", void 0);
|
|
227
|
-
tslib_1.__decorate([
|
|
228
|
-
(0, inversify_1.inject)(browser_1.QuickAccessRegistry),
|
|
229
|
-
tslib_1.__metadata("design:type", Object)
|
|
230
|
-
], QuickFileSelectService.prototype, "quickAccessRegistry", void 0);
|
|
231
|
-
tslib_1.__decorate([
|
|
232
|
-
(0, inversify_1.inject)(file_search_service_1.FileSearchService),
|
|
233
|
-
tslib_1.__metadata("design:type", Object)
|
|
234
|
-
], QuickFileSelectService.prototype, "fileSearchService", void 0);
|
|
235
|
-
tslib_1.__decorate([
|
|
236
|
-
(0, inversify_1.inject)(label_provider_1.LabelProvider),
|
|
237
|
-
tslib_1.__metadata("design:type", label_provider_1.LabelProvider)
|
|
238
|
-
], QuickFileSelectService.prototype, "labelProvider", void 0);
|
|
239
|
-
tslib_1.__decorate([
|
|
240
|
-
(0, inversify_1.inject)(navigation_location_service_1.NavigationLocationService),
|
|
241
|
-
tslib_1.__metadata("design:type", navigation_location_service_1.NavigationLocationService)
|
|
242
|
-
], QuickFileSelectService.prototype, "navigationLocationService", void 0);
|
|
243
|
-
tslib_1.__decorate([
|
|
244
|
-
(0, inversify_1.inject)(message_service_1.MessageService),
|
|
245
|
-
tslib_1.__metadata("design:type", message_service_1.MessageService)
|
|
246
|
-
], QuickFileSelectService.prototype, "messageService", void 0);
|
|
247
|
-
tslib_1.__decorate([
|
|
248
|
-
(0, inversify_1.inject)(common_2.FileSystemPreferences),
|
|
249
|
-
tslib_1.__metadata("design:type", Object)
|
|
250
|
-
], QuickFileSelectService.prototype, "fsPreferences", void 0);
|
|
251
|
-
tslib_1.__decorate([
|
|
252
|
-
(0, inversify_1.inject)(common_1.PreferenceService),
|
|
253
|
-
tslib_1.__metadata("design:type", Object)
|
|
254
|
-
], QuickFileSelectService.prototype, "preferences", void 0);
|
|
255
|
-
exports.QuickFileSelectService = QuickFileSelectService = QuickFileSelectService_1 = tslib_1.__decorate([
|
|
256
|
-
(0, inversify_1.injectable)()
|
|
257
|
-
], QuickFileSelectService);
|
|
258
|
-
/**
|
|
259
|
-
* Normalize a given string.
|
|
260
|
-
*
|
|
261
|
-
* @param str the raw string value.
|
|
262
|
-
* @returns the normalized string value.
|
|
263
|
-
*/
|
|
264
|
-
function normalize(str) {
|
|
265
|
-
return str.trim().toLowerCase();
|
|
266
|
-
}
|
|
267
|
-
function compareWithDiscriminators(left, right, ...discriminators) {
|
|
268
|
-
let comparisonValue = 0;
|
|
269
|
-
let i = 0;
|
|
270
|
-
while (comparisonValue === 0 && i < discriminators.length) {
|
|
271
|
-
comparisonValue = discriminators[i](left, right);
|
|
272
|
-
i++;
|
|
273
|
-
}
|
|
274
|
-
return comparisonValue;
|
|
275
|
-
}
|
|
276
|
-
//# sourceMappingURL=quick-file-select-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quick-file-select-service.js","sourceRoot":"","sources":["../../src/browser/quick-file-select-service.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,qDAAiG;AACjG,2EAAuE;AACvE,iGAAoI;AACpI,mDAAuG;AACvG,4EAAwE;AACxE,oDAA6C;AAC7C,kDAAkD;AAClD,4DAA4E;AAC5E,uDAA4D;AAC5D,kHAA6G;AAC7G,yDAAqE;AACrE,sFAAkF;AAClF,uEAA8F;AAc9F,sDAAsD;AACtD,MAAM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GAAE;;iEACkB;AAErC;IADlB,IAAA,kBAAM,EAAC,6BAAmB,CAAC;;mEACgC;AAEzC;IADlB,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;iEAC8B;AAErC;IADlB,IAAA,kBAAM,EAAC,8BAAa,CAAC;sCACY,8BAAa;6DAAC;AAE7B;IADlB,IAAA,kBAAM,EAAC,uDAAyB,CAAC;sCACY,uDAAyB;yEAAC;AAErD;IADlB,IAAA,kBAAM,EAAC,gCAAc,CAAC;sCACY,gCAAc;8DAAC;AAE/B;IADlB,IAAA,kBAAM,EAAC,8BAAqB,CAAC;;6DAC0B;AAErC;IADlB,IAAA,kBAAM,EAAC,0BAAiB,CAAC;;2DACwB;iCAvBzC,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA+NlC;AAED;;;;;GAKG;AACH,SAAS,SAAS,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpC,CAAC;AAED,SAAS,yBAAyB,CAAI,IAAO,EAAE,KAAQ,EAAE,GAAG,cAAiD;IACzG,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,eAAe,KAAK,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QACxD,eAAe,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC,EAAE,CAAC;IACR,CAAC;IACD,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-search-frontend-only-module.d.ts","sourceRoot":"","sources":["../../src/browser-only/file-search-frontend-only-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAc,MAAM,8BAA8B,CAAC;;AAU3E,wBAWG"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 Maksim Kachurin 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 browser_1 = require("@theia/core/lib/browser");
|
|
21
|
-
const file_search_service_1 = require("../common/file-search-service");
|
|
22
|
-
const file_search_service_impl_1 = require("./file-search-service-impl");
|
|
23
|
-
const quick_access_1 = require("@theia/core/lib/browser/quick-input/quick-access");
|
|
24
|
-
const quick_file_open_contribution_1 = require("../browser/quick-file-open-contribution");
|
|
25
|
-
const quick_file_open_1 = require("../browser/quick-file-open");
|
|
26
|
-
const quick_file_select_service_1 = require("../browser/quick-file-select-service");
|
|
27
|
-
exports.default = new inversify_1.ContainerModule((bind) => {
|
|
28
|
-
bind(file_search_service_1.FileSearchService).to(file_search_service_impl_1.FileSearchServiceImpl).inSingletonScope();
|
|
29
|
-
bind(quick_file_open_contribution_1.QuickFileOpenFrontendContribution).toSelf().inSingletonScope();
|
|
30
|
-
[common_1.CommandContribution, browser_1.KeybindingContribution, common_1.MenuContribution, quick_access_1.QuickAccessContribution].forEach(serviceIdentifier => bind(serviceIdentifier).toService(quick_file_open_contribution_1.QuickFileOpenFrontendContribution));
|
|
31
|
-
bind(quick_file_select_service_1.QuickFileSelectService).toSelf().inSingletonScope();
|
|
32
|
-
bind(quick_file_open_1.QuickFileOpenService).toSelf().inSingletonScope();
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=file-search-frontend-only-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-search-frontend-only-module.js","sourceRoot":"","sources":["../../src/browser-only/file-search-frontend-only-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,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,4DAA2E;AAC3E,mDAA+E;AAC/E,qDAAiE;AACjE,uEAAkE;AAClE,yEAAmE;AACnE,mFAA2F;AAC3F,0FAA4F;AAC5F,gEAAkE;AAClE,oFAA8E;AAE9E,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,EAAE;IACzD,IAAI,CAAC,uCAAiB,CAAC,CAAC,EAAE,CAAC,gDAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAErE,IAAI,CAAC,gEAAiC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAEpE,CAAC,4BAAmB,EAAE,gCAAsB,EAAE,yBAAgB,EAAE,sCAAuB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CACjH,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,gEAAiC,CAAC,CACvE,CAAC;IAEF,IAAI,CAAC,kDAAsB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACzD,IAAI,CAAC,sCAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAC3D,CAAC,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { FileSearchService } from '../common/file-search-service';
|
|
2
|
-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
3
|
-
import { CancellationToken, ILogger, URI } from '@theia/core';
|
|
4
|
-
export declare class FileSearchServiceImpl implements FileSearchService {
|
|
5
|
-
protected logger: ILogger;
|
|
6
|
-
protected readonly fs: FileService;
|
|
7
|
-
/**
|
|
8
|
-
* Searches for files matching the given pattern.
|
|
9
|
-
* @param searchPattern - The pattern to search for
|
|
10
|
-
* @param options - Search options including root URIs and filters
|
|
11
|
-
* @param clientToken - Optional cancellation token
|
|
12
|
-
* @returns Promise resolving to array of matching file URIs
|
|
13
|
-
*/
|
|
14
|
-
find(searchPattern: string, options: FileSearchService.Options, clientToken?: CancellationToken): Promise<string[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Performs the actual file search within a root directory.
|
|
17
|
-
* @param rootUri - The root URI to search in
|
|
18
|
-
* @param options - Search options for this root
|
|
19
|
-
* @param accept - Callback function for each matching file
|
|
20
|
-
* @param token - Cancellation token
|
|
21
|
-
*/
|
|
22
|
-
protected doFind(rootUri: URI, options: FileSearchService.BaseOptions, accept: (fileUri: string) => void, token: CancellationToken): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Checks if a path should be excluded based on exclude patterns.
|
|
25
|
-
* @param uri - The URI to check
|
|
26
|
-
* @param excludePatterns - Array of exclude patterns
|
|
27
|
-
* @returns True if the path should be excluded
|
|
28
|
-
*/
|
|
29
|
-
private shouldExcludePath;
|
|
30
|
-
/**
|
|
31
|
-
* Checks if a path should be included based on include patterns.
|
|
32
|
-
* @param uri - The URI to check
|
|
33
|
-
* @param includePatterns - Array of include patterns
|
|
34
|
-
* @returns True if the path should be included
|
|
35
|
-
*/
|
|
36
|
-
private shouldIncludePath;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=file-search-service-impl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-search-service-impl.d.ts","sourceRoot":"","sources":["../../src/browser-only/file-search-service-impl.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAA8B,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAEzE,OAAO,EAA2B,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGvF,qBACa,qBAAsB,YAAW,iBAAiB;IAG3D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAG1B,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC;IAEnC;;;;;;OAMG;IACG,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA6FzH;;;;;;OAMG;cACa,MAAM,CAClB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,iBAAiB,CAAC,WAAW,EACtC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACjC,KAAK,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC;IAmDhB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAazB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CAY5B"}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 Maksim Kachurin 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.FileSearchServiceImpl = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const file_search_service_1 = require("../common/file-search-service");
|
|
22
|
-
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
23
|
-
const fuzzy = require("@theia/core/shared/fuzzy");
|
|
24
|
-
const core_1 = require("@theia/core");
|
|
25
|
-
const file_search_1 = require("@theia/filesystem/lib/browser-only/file-search");
|
|
26
|
-
let FileSearchServiceImpl = class FileSearchServiceImpl {
|
|
27
|
-
/**
|
|
28
|
-
* Searches for files matching the given pattern.
|
|
29
|
-
* @param searchPattern - The pattern to search for
|
|
30
|
-
* @param options - Search options including root URIs and filters
|
|
31
|
-
* @param clientToken - Optional cancellation token
|
|
32
|
-
* @returns Promise resolving to array of matching file URIs
|
|
33
|
-
*/
|
|
34
|
-
async find(searchPattern, options, clientToken) {
|
|
35
|
-
const cancellationSource = new core_1.CancellationTokenSource();
|
|
36
|
-
if (clientToken) {
|
|
37
|
-
clientToken.onCancellationRequested(() => cancellationSource.cancel());
|
|
38
|
-
}
|
|
39
|
-
const token = cancellationSource.token;
|
|
40
|
-
const opts = {
|
|
41
|
-
fuzzyMatch: true,
|
|
42
|
-
limit: Number.MAX_SAFE_INTEGER,
|
|
43
|
-
useGitIgnore: true,
|
|
44
|
-
...options
|
|
45
|
-
};
|
|
46
|
-
// Merge root-specific options with global options
|
|
47
|
-
const roots = options.rootOptions || {};
|
|
48
|
-
if (options.rootUris) {
|
|
49
|
-
for (const rootUri of options.rootUris) {
|
|
50
|
-
if (!roots[rootUri]) {
|
|
51
|
-
roots[rootUri] = {};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// eslint-disable-next-line guard-for-in
|
|
56
|
-
for (const rootUri in roots) {
|
|
57
|
-
const rootOptions = roots[rootUri];
|
|
58
|
-
if (opts.includePatterns) {
|
|
59
|
-
const includePatterns = rootOptions.includePatterns || [];
|
|
60
|
-
rootOptions.includePatterns = [...includePatterns, ...opts.includePatterns];
|
|
61
|
-
}
|
|
62
|
-
if (opts.excludePatterns) {
|
|
63
|
-
const excludePatterns = rootOptions.excludePatterns || [];
|
|
64
|
-
rootOptions.excludePatterns = [...excludePatterns, ...opts.excludePatterns];
|
|
65
|
-
}
|
|
66
|
-
if (rootOptions.useGitIgnore === undefined) {
|
|
67
|
-
rootOptions.useGitIgnore = opts.useGitIgnore;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const exactMatches = new Set();
|
|
71
|
-
const fuzzyMatches = new Set();
|
|
72
|
-
// Split search pattern into individual terms for matching
|
|
73
|
-
const patterns = searchPattern.toLowerCase().split(file_search_service_1.WHITESPACE_QUERY_SEPARATOR).map(pattern => pattern.trim()).filter(Boolean);
|
|
74
|
-
await Promise.all(Object.keys(roots).map(async (root) => {
|
|
75
|
-
try {
|
|
76
|
-
const rootUri = new core_1.URI(root);
|
|
77
|
-
const rootOptions = roots[root];
|
|
78
|
-
await this.doFind(rootUri, rootOptions, (fileUri) => {
|
|
79
|
-
// Skip already matched files
|
|
80
|
-
if (exactMatches.has(fileUri) || fuzzyMatches.has(fileUri)) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
// Check for exact pattern matches
|
|
84
|
-
const candidatePattern = fileUri.toLowerCase();
|
|
85
|
-
const patternExists = patterns.every(pattern => candidatePattern.includes(pattern));
|
|
86
|
-
if (patternExists) {
|
|
87
|
-
exactMatches.add(fileUri);
|
|
88
|
-
}
|
|
89
|
-
else if (!searchPattern || searchPattern === '*') {
|
|
90
|
-
exactMatches.add(fileUri);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
// Check for fuzzy matches if enabled
|
|
94
|
-
const fuzzyPatternExists = patterns.every(pattern => fuzzy.test(pattern, candidatePattern));
|
|
95
|
-
if (opts.fuzzyMatch && fuzzyPatternExists) {
|
|
96
|
-
fuzzyMatches.add(fileUri);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// Cancel search if limit reached
|
|
100
|
-
if ((exactMatches.size + fuzzyMatches.size) >= opts.limit) {
|
|
101
|
-
cancellationSource.cancel();
|
|
102
|
-
}
|
|
103
|
-
}, token);
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
|
-
this.logger.error('Failed to search:', root, e);
|
|
107
|
-
}
|
|
108
|
-
}));
|
|
109
|
-
if (clientToken === null || clientToken === void 0 ? void 0 : clientToken.isCancellationRequested) {
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
// Return results up to the specified limit
|
|
113
|
-
return [...exactMatches, ...fuzzyMatches].slice(0, opts.limit);
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Performs the actual file search within a root directory.
|
|
117
|
-
* @param rootUri - The root URI to search in
|
|
118
|
-
* @param options - Search options for this root
|
|
119
|
-
* @param accept - Callback function for each matching file
|
|
120
|
-
* @param token - Cancellation token
|
|
121
|
-
*/
|
|
122
|
-
async doFind(rootUri, options, accept, token) {
|
|
123
|
-
const matcher = (0, file_search_1.createIgnoreMatcher)();
|
|
124
|
-
const queue = [rootUri];
|
|
125
|
-
let queueIndex = 0;
|
|
126
|
-
while (queueIndex < queue.length) {
|
|
127
|
-
if (token.isCancellationRequested) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const currentUri = queue[queueIndex++];
|
|
131
|
-
try {
|
|
132
|
-
// Skip excluded paths
|
|
133
|
-
if (this.shouldExcludePath(currentUri, options.excludePatterns)) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
const stat = await this.fs.resolve(currentUri);
|
|
137
|
-
const relPath = currentUri.path.toString().replace(/^\/|^\.\//, '');
|
|
138
|
-
// Skip paths ignored by gitignore patterns
|
|
139
|
-
if (options.useGitIgnore && relPath && matcher.ignores(relPath)) {
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
// Accept file if it matches include patterns
|
|
143
|
-
if (stat.isFile && this.shouldIncludePath(currentUri, options.includePatterns)) {
|
|
144
|
-
accept(currentUri.toString());
|
|
145
|
-
}
|
|
146
|
-
else if (stat.isDirectory && Array.isArray(stat.children)) {
|
|
147
|
-
// Process ignore files in directory
|
|
148
|
-
if (options.useGitIgnore) {
|
|
149
|
-
const patterns = await (0, file_search_1.getIgnorePatterns)(currentUri, uri => this.fs.read(uri).then(content => content.value));
|
|
150
|
-
matcher.add(patterns);
|
|
151
|
-
}
|
|
152
|
-
// Add children to search queue
|
|
153
|
-
for (const child of stat.children) {
|
|
154
|
-
queue.push(child.resource);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
catch (e) {
|
|
159
|
-
this.logger.error(`Error reading directory: ${currentUri.toString()}`, e);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Checks if a path should be excluded based on exclude patterns.
|
|
165
|
-
* @param uri - The URI to check
|
|
166
|
-
* @param excludePatterns - Array of exclude patterns
|
|
167
|
-
* @returns True if the path should be excluded
|
|
168
|
-
*/
|
|
169
|
-
shouldExcludePath(uri, excludePatterns) {
|
|
170
|
-
if (!(excludePatterns === null || excludePatterns === void 0 ? void 0 : excludePatterns.length)) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
const path = uri.path.toString();
|
|
174
|
-
return (0, file_search_1.matchesPattern)(path, excludePatterns, {
|
|
175
|
-
dot: true,
|
|
176
|
-
matchBase: true,
|
|
177
|
-
nocase: true
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Checks if a path should be included based on include patterns.
|
|
182
|
-
* @param uri - The URI to check
|
|
183
|
-
* @param includePatterns - Array of include patterns
|
|
184
|
-
* @returns True if the path should be included
|
|
185
|
-
*/
|
|
186
|
-
shouldIncludePath(uri, includePatterns) {
|
|
187
|
-
if (!(includePatterns === null || includePatterns === void 0 ? void 0 : includePatterns.length)) {
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
const path = uri.path.toString();
|
|
191
|
-
return (0, file_search_1.matchesPattern)(path, includePatterns, {
|
|
192
|
-
dot: true,
|
|
193
|
-
matchBase: true,
|
|
194
|
-
nocase: true
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
exports.FileSearchServiceImpl = FileSearchServiceImpl;
|
|
199
|
-
tslib_1.__decorate([
|
|
200
|
-
(0, inversify_1.inject)(core_1.ILogger),
|
|
201
|
-
(0, inversify_1.named)('file-search'),
|
|
202
|
-
tslib_1.__metadata("design:type", Object)
|
|
203
|
-
], FileSearchServiceImpl.prototype, "logger", void 0);
|
|
204
|
-
tslib_1.__decorate([
|
|
205
|
-
(0, inversify_1.inject)(file_service_1.FileService),
|
|
206
|
-
tslib_1.__metadata("design:type", file_service_1.FileService)
|
|
207
|
-
], FileSearchServiceImpl.prototype, "fs", void 0);
|
|
208
|
-
exports.FileSearchServiceImpl = FileSearchServiceImpl = tslib_1.__decorate([
|
|
209
|
-
(0, inversify_1.injectable)()
|
|
210
|
-
], FileSearchServiceImpl);
|
|
211
|
-
//# sourceMappingURL=file-search-service-impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-search-service-impl.js","sourceRoot":"","sources":["../../src/browser-only/file-search-service-impl.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAw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AQ,EAAE,eAAqC;QACrE,IAAI,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAA,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAA,4BAAc,EAAC,IAAI,EAAE,eAAe,EAAE;YACzC,GAAG,EAAE,IAAI;YACT,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;SACf,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAhNY,sDAAqB;AAGpB;IAFT,IAAA,kBAAM,EAAC,cAAO,CAAC;IACf,IAAA,iBAAK,EAAC,aAAa,CAAC;;qDACK;AAGP;IADlB,IAAA,kBAAM,EAAC,0BAAW,CAAC;sCACG,0BAAW;iDAAC;gCAN1B,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAgNjC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=file-search-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-search-service.d.ts","sourceRoot":"","sources":["../../src/common/file-search-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAE9B;;;OAGG;IACH,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAE7H;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,yBAAiB,iBAAiB,CAAC;IAC/B,UAAiB,WAAW;QACxB,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;QAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;KAC7B;IACD,UAAiB,WAAW;QACxB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAA;KACjC;IACD,UAAiB,OAAQ,SAAQ,WAAW;QACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,WAAW,CAAC,EAAE,WAAW,CAAA;QACzB,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,KAAK,CAAC,EAAE,MAAM,CAAA;KACjB;CACJ;AAED,eAAO,MAAM,0BAA0B,QAAQ,CAAC"}
|