@codingame/monaco-vscode-search-service-override 5.3.0 → 6.0.0
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/package.json +2 -2
- package/search.js +37 -3
- package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -2
- package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +3 -2
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +2 -1
- package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +20 -17
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +11 -9
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +49 -47
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +18 -16
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +6 -3
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +2 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +13 -11
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +4 -4
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +33 -28
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +36 -32
- package/vscode/src/vs/workbench/contrib/search/common/searchHistoryService.js +5 -4
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +26 -24
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +7 -4
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +2 -1
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +11 -8
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +3 -3
- package/vscode/src/vs/workbench/services/search/browser/searchService.js +4 -27
- package/vscode/src/vs/workbench/services/search/common/searchService.js +19 -19
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -764
- package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -224
- package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import
|
|
2
|
+
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
3
3
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
4
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
6
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
7
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
8
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
9
4
|
import 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
10
|
-
import
|
|
5
|
+
import '../common/searchService.js';
|
|
11
6
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
12
7
|
import { SimpleWorkerClient, logOnceWebWorkerWarning } from 'vscode/vscode/vs/base/common/worker/simpleWorker';
|
|
13
8
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
14
9
|
import { DefaultWorkerFactory } from 'vscode/vscode/vs/base/browser/defaultWorkerFactory';
|
|
10
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
15
11
|
import { memoize } from 'vscode/vscode/vs/base/common/decorators';
|
|
16
12
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
17
13
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
@@ -22,25 +18,6 @@ import { revive } from 'vscode/vscode/vs/base/common/marshalling';
|
|
|
22
18
|
import { TextSearchCompleteMessageType } from 'vscode/vscode/vs/workbench/services/search/common/searchExtTypes';
|
|
23
19
|
|
|
24
20
|
const _moduleId = "vs/workbench/services/search/browser/searchService";
|
|
25
|
-
let RemoteSearchService = class RemoteSearchService extends SearchService {
|
|
26
|
-
constructor(modelService, editorService, telemetryService, logService, extensionService, fileService, instantiationService, uriIdentityService) {
|
|
27
|
-
super(modelService, editorService, telemetryService, logService, extensionService, fileService, uriIdentityService);
|
|
28
|
-
this.instantiationService = instantiationService;
|
|
29
|
-
const searchProvider = this.instantiationService.createInstance(LocalFileSearchWorkerClient);
|
|
30
|
-
this.registerSearchResultProvider(Schemas.file, 0 , searchProvider);
|
|
31
|
-
this.registerSearchResultProvider(Schemas.file, 1 , searchProvider);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
RemoteSearchService = ( (__decorate([
|
|
35
|
-
( (__param(0, IModelService))),
|
|
36
|
-
( (__param(1, IEditorService))),
|
|
37
|
-
( (__param(2, ITelemetryService))),
|
|
38
|
-
( (__param(3, ILogService))),
|
|
39
|
-
( (__param(4, IExtensionService))),
|
|
40
|
-
( (__param(5, IFileService))),
|
|
41
|
-
( (__param(6, IInstantiationService))),
|
|
42
|
-
( (__param(7, IUriIdentityService)))
|
|
43
|
-
], RemoteSearchService)));
|
|
44
21
|
let LocalFileSearchWorkerClient = class LocalFileSearchWorkerClient extends Disposable {
|
|
45
22
|
constructor(fileService, uriIdentityService) {
|
|
46
23
|
super();
|
|
@@ -175,4 +152,4 @@ LocalFileSearchWorkerClient = ( (__decorate([
|
|
|
175
152
|
( (__param(1, IUriIdentityService)))
|
|
176
153
|
], LocalFileSearchWorkerClient)));
|
|
177
154
|
|
|
178
|
-
export { LocalFileSearchWorkerClient
|
|
155
|
+
export { LocalFileSearchWorkerClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { coalesce,
|
|
2
|
+
import { coalesce, uniqueFilter } from 'vscode/vscode/vs/base/common/arrays';
|
|
3
3
|
import { raceCancellationError, DeferredPromise } from 'vscode/vscode/vs/base/common/async';
|
|
4
4
|
import { CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
5
5
|
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
@@ -15,7 +15,7 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
15
15
|
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
16
16
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
17
17
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
|
-
import { isFileMatch, isProgressMessage, deserializeSearchError, SearchErrorCode, SEARCH_RESULT_LANGUAGE_ID, FileMatch, pathIncludedInQuery } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
18
|
+
import { SearchProviderType, isFileMatch, isProgressMessage, QueryType, deserializeSearchError, SearchErrorCode, SEARCH_RESULT_LANGUAGE_ID, FileMatch, pathIncludedInQuery } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
19
19
|
import { editorMatchesToTextSearchResults, getTextSearchMatchWithModelContext } from 'vscode/vscode/vs/workbench/services/search/common/searchHelpers';
|
|
20
20
|
|
|
21
21
|
let SearchService = class SearchService extends Disposable {
|
|
@@ -39,15 +39,15 @@ let SearchService = class SearchService extends Disposable {
|
|
|
39
39
|
registerSearchResultProvider(scheme, type, provider) {
|
|
40
40
|
let list;
|
|
41
41
|
let deferredMap;
|
|
42
|
-
if (type ===
|
|
42
|
+
if (type === SearchProviderType.file) {
|
|
43
43
|
list = this.fileSearchProviders;
|
|
44
44
|
deferredMap = this.deferredFileSearchesByScheme;
|
|
45
45
|
}
|
|
46
|
-
else if (type ===
|
|
46
|
+
else if (type === SearchProviderType.text) {
|
|
47
47
|
list = this.textSearchProviders;
|
|
48
48
|
deferredMap = this.deferredTextSearchesByScheme;
|
|
49
49
|
}
|
|
50
|
-
else if (type ===
|
|
50
|
+
else if (type === SearchProviderType.aiText) {
|
|
51
51
|
list = this.aiTextSearchProviders;
|
|
52
52
|
deferredMap = this.deferredAITextSearchesByScheme;
|
|
53
53
|
}
|
|
@@ -156,8 +156,8 @@ let SearchService = class SearchService extends Disposable {
|
|
|
156
156
|
return {
|
|
157
157
|
limitHit: completes[0] && completes[0].limitHit,
|
|
158
158
|
stats: completes[0].stats,
|
|
159
|
-
messages: coalesce(
|
|
160
|
-
results:
|
|
159
|
+
messages: coalesce(completes.flatMap(i => i.messages)).filter(uniqueFilter(message => message.type + message.text + message.trusted)),
|
|
160
|
+
results: completes.flatMap((c) => c.results)
|
|
161
161
|
};
|
|
162
162
|
})();
|
|
163
163
|
return token ? raceCancellationError(providerPromise, token) : providerPromise;
|
|
@@ -181,11 +181,11 @@ let SearchService = class SearchService extends Disposable {
|
|
|
181
181
|
}
|
|
182
182
|
getSearchProvider(type) {
|
|
183
183
|
switch (type) {
|
|
184
|
-
case
|
|
184
|
+
case QueryType.File:
|
|
185
185
|
return this.fileSearchProviders;
|
|
186
|
-
case
|
|
186
|
+
case QueryType.Text:
|
|
187
187
|
return this.textSearchProviders;
|
|
188
|
-
case
|
|
188
|
+
case QueryType.aiText:
|
|
189
189
|
return this.aiTextSearchProviders;
|
|
190
190
|
default:
|
|
191
191
|
throw ( new Error(`Unknown query type: ${type}`));
|
|
@@ -193,11 +193,11 @@ let SearchService = class SearchService extends Disposable {
|
|
|
193
193
|
}
|
|
194
194
|
getDeferredTextSearchesByScheme(type) {
|
|
195
195
|
switch (type) {
|
|
196
|
-
case
|
|
196
|
+
case QueryType.File:
|
|
197
197
|
return this.deferredFileSearchesByScheme;
|
|
198
|
-
case
|
|
198
|
+
case QueryType.Text:
|
|
199
199
|
return this.deferredTextSearchesByScheme;
|
|
200
|
-
case
|
|
200
|
+
case QueryType.aiText:
|
|
201
201
|
return this.deferredAITextSearchesByScheme;
|
|
202
202
|
default:
|
|
203
203
|
throw ( new Error(`Unknown query type: ${type}`));
|
|
@@ -210,7 +210,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
210
210
|
const someSchemeHasProvider = ( [...( fqs.keys())].some(scheme => {
|
|
211
211
|
return ( this.getSearchProvider(query.type).has(scheme));
|
|
212
212
|
}));
|
|
213
|
-
if (query.type ===
|
|
213
|
+
if (query.type === QueryType.aiText && !someSchemeHasProvider) {
|
|
214
214
|
return [];
|
|
215
215
|
}
|
|
216
216
|
await Promise.all(( [...( fqs.keys())].map(async (scheme) => {
|
|
@@ -240,9 +240,9 @@ let SearchService = class SearchService extends Disposable {
|
|
|
240
240
|
};
|
|
241
241
|
const doProviderSearch = () => {
|
|
242
242
|
switch (query.type) {
|
|
243
|
-
case
|
|
243
|
+
case QueryType.File:
|
|
244
244
|
return provider.fileSearch(oneSchemeQuery, token);
|
|
245
|
-
case
|
|
245
|
+
case QueryType.Text:
|
|
246
246
|
return provider.textSearch(oneSchemeQuery, onProviderProgress, token);
|
|
247
247
|
default:
|
|
248
248
|
return provider.textSearch(oneSchemeQuery, onProviderProgress, token);
|
|
@@ -281,7 +281,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
281
281
|
const scheme = fileSchemeOnly ? Schemas.file :
|
|
282
282
|
otherSchemeOnly ? 'other' :
|
|
283
283
|
'mixed';
|
|
284
|
-
if (query.type ===
|
|
284
|
+
if (query.type === QueryType.File && complete && complete.stats) {
|
|
285
285
|
const fileSearchStats = complete.stats;
|
|
286
286
|
if (fileSearchStats.fromCache) {
|
|
287
287
|
const cacheStats = fileSearchStats.detailStats;
|
|
@@ -315,7 +315,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
else if (query.type ===
|
|
318
|
+
else if (query.type === QueryType.Text) {
|
|
319
319
|
let errorType;
|
|
320
320
|
if (err) {
|
|
321
321
|
errorType = err.code === SearchErrorCode.regexParseError ? 'regex' :
|
|
@@ -338,7 +338,7 @@ let SearchService = class SearchService extends Disposable {
|
|
|
338
338
|
getOpenEditorResults(query) {
|
|
339
339
|
const openEditorResults = ( new ResourceMap(uri => this.uriIdentityService.extUri.getComparisonKey(uri)));
|
|
340
340
|
let limitHit = false;
|
|
341
|
-
if (query.type ===
|
|
341
|
+
if (query.type === QueryType.Text) {
|
|
342
342
|
const canonicalToOriginalResources = ( new ResourceMap());
|
|
343
343
|
for (const editorInput of this.editorService.editors) {
|
|
344
344
|
const canonical = EditorResourceAccessor.getCanonicalUri(editorInput, { supportSideBySide: SideBySideEditor.PRIMARY });
|