@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-search-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
32
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/search.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
1
2
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
2
3
|
import { ISearchService } from 'vscode/vscode/vs/workbench/services/search/common/search.service';
|
|
3
4
|
import { SearchService } from './vscode/src/vs/workbench/services/search/common/searchService.js';
|
|
@@ -7,13 +8,46 @@ import { SearchHistoryService } from './vscode/src/vs/workbench/contrib/search/c
|
|
|
7
8
|
import { ISearchHistoryService } from 'vscode/vscode/vs/workbench/contrib/search/common/searchHistoryService.service';
|
|
8
9
|
import { IReplaceService } from 'vscode/vscode/vs/workbench/contrib/search/browser/replace.service';
|
|
9
10
|
import { ReplaceService } from './vscode/src/vs/workbench/contrib/search/browser/replaceService.js';
|
|
10
|
-
import {
|
|
11
|
+
import { LocalFileSearchWorkerClient } from './vscode/src/vs/workbench/services/search/browser/searchService.js';
|
|
11
12
|
import './vscode/src/vs/workbench/contrib/search/browser/search.contribution.js';
|
|
12
13
|
import './vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js';
|
|
14
|
+
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
15
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
17
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
19
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
20
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
21
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
22
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
13
23
|
|
|
14
|
-
function
|
|
24
|
+
function isHTMLFileSystemProvider(provider) {
|
|
25
|
+
return provider.directories != null;
|
|
26
|
+
}
|
|
27
|
+
let CustomSearchService = class CustomSearchService extends SearchService {
|
|
28
|
+
constructor(modelService, editorService, telemetryService, logService, extensionService, fileService, instantiationService, uriIdentityService) {
|
|
29
|
+
super(modelService, editorService, telemetryService, logService, extensionService, fileService, uriIdentityService);
|
|
30
|
+
this.instantiationService = instantiationService;
|
|
31
|
+
if (isHTMLFileSystemProvider(fileService.getProvider(Schemas.file))) {
|
|
32
|
+
const searchProvider = this.instantiationService.createInstance(LocalFileSearchWorkerClient);
|
|
33
|
+
this.registerSearchResultProvider(Schemas.file, 0 , searchProvider);
|
|
34
|
+
this.registerSearchResultProvider(Schemas.file, 1 , searchProvider);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
CustomSearchService = __decorate([
|
|
39
|
+
( __param(0, IModelService)),
|
|
40
|
+
( __param(1, IEditorService)),
|
|
41
|
+
( __param(2, ITelemetryService)),
|
|
42
|
+
( __param(3, ILogService)),
|
|
43
|
+
( __param(4, IExtensionService)),
|
|
44
|
+
( __param(5, IFileService)),
|
|
45
|
+
( __param(6, IInstantiationService)),
|
|
46
|
+
( __param(7, IUriIdentityService))
|
|
47
|
+
], CustomSearchService);
|
|
48
|
+
function getServiceOverride() {
|
|
15
49
|
return {
|
|
16
|
-
[( ISearchService.toString())]:
|
|
50
|
+
[( ISearchService.toString())]: new SyncDescriptor(CustomSearchService, [], true),
|
|
17
51
|
[( ISearchViewModelWorkbenchService.toString())]: new SyncDescriptor(SearchViewModelWorkbenchService, [], true),
|
|
18
52
|
[( ISearchHistoryService.toString())]: new SyncDescriptor(SearchHistoryService, [], true),
|
|
19
53
|
[( IReplaceService.toString())]: new SyncDescriptor(ReplaceService, [], true)
|
|
@@ -4,6 +4,7 @@ import { Toggle } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
|
|
|
4
4
|
import { Widget } from 'vscode/vscode/vs/base/browser/ui/widget';
|
|
5
5
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
6
6
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
7
|
+
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
7
8
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
8
9
|
import { ContextScopedHistoryInputBox } from 'vscode/vscode/vs/platform/history/browser/contextScopedHistoryWidget';
|
|
9
10
|
import { showHistoryKeybindingHint } from 'vscode/vscode/vs/platform/history/browser/historyWidgetKeybindingHint';
|
|
@@ -117,11 +118,11 @@ let PatternInputWidget = class PatternInputWidget extends Widget {
|
|
|
117
118
|
}
|
|
118
119
|
onInputKeyUp(keyboardEvent) {
|
|
119
120
|
switch (keyboardEvent.keyCode) {
|
|
120
|
-
case
|
|
121
|
+
case KeyCode.Enter:
|
|
121
122
|
this.onSearchSubmit();
|
|
122
123
|
this._onSubmit.fire(false);
|
|
123
124
|
return;
|
|
124
|
-
case
|
|
125
|
+
case KeyCode.Escape:
|
|
125
126
|
this._onCancel.fire();
|
|
126
127
|
return;
|
|
127
128
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
1
2
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
2
3
|
import { ReplacePreviewContentProvider } from './replaceService.js';
|
|
3
|
-
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
5
|
|
|
5
6
|
function registerContributions() {
|
|
6
|
-
registerWorkbenchContribution2(ReplacePreviewContentProvider.ID, ReplacePreviewContentProvider,
|
|
7
|
+
registerWorkbenchContribution2(ReplacePreviewContentProvider.ID, ReplacePreviewContentProvider, WorkbenchPhase.BlockStartup );
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export { registerContributions };
|
|
@@ -9,6 +9,7 @@ import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/langu
|
|
|
9
9
|
import { Match, MatchInNotebook, FileMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
|
|
10
10
|
import { ISearchViewModelWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel.service';
|
|
11
11
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
12
|
+
import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
|
|
12
13
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
14
|
import { createTextBufferFactoryFromSnapshot } from 'vscode/vscode/vs/editor/common/model/textModel';
|
|
14
15
|
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
@@ -148,7 +149,7 @@ let ReplaceService = class ReplaceService {
|
|
|
148
149
|
if (editor) {
|
|
149
150
|
const editorControl = editor.getControl();
|
|
150
151
|
if (element instanceof Match && editorControl) {
|
|
151
|
-
editorControl.revealLineInCenter(element.range().startLineNumber,
|
|
152
|
+
editorControl.revealLineInCenter(element.range().startLineNumber, ScrollType.Immediate);
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
1
2
|
import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
2
3
|
import { AbstractGotoLineQuickAccessProvider } from 'vscode/vscode/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess';
|
|
3
4
|
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
-
import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
5
|
+
import { Extensions as Extensions$2, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
5
6
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
7
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
8
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
7
9
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/quickinput/common/quickAccess';
|
|
8
10
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
9
11
|
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
10
12
|
import { defaultQuickAccessContextKeyValue } from 'vscode/vscode/vs/workbench/browser/quickaccess';
|
|
11
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
13
|
+
import { Extensions, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
14
|
import { GotoSymbolQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess';
|
|
13
|
-
import { AnythingQuickAccessProvider } from '
|
|
15
|
+
import { AnythingQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/search/browser/anythingQuickAccess';
|
|
14
16
|
import { registerContributions } from './replaceContributions.js';
|
|
15
17
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
16
18
|
import 'vscode/vscode/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService';
|
|
17
19
|
import { searchViewIcon } from './searchIcons.js';
|
|
18
20
|
import { SearchView } from './searchView.js';
|
|
19
21
|
import { registerContributions as registerContributions$1 } from './searchWidget.js';
|
|
20
|
-
import { SymbolsQuickAccessProvider } from '
|
|
22
|
+
import { SymbolsQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/search/browser/symbolsQuickAccess';
|
|
21
23
|
import '../common/searchHistoryService.js';
|
|
22
24
|
import 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
|
|
23
|
-
import { VIEWLET_ID, VIEW_ID, SEARCH_EXCLUDE_CONFIG } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
25
|
+
import { VIEWLET_ID, VIEW_ID, SEARCH_EXCLUDE_CONFIG, SearchSortOrder, ViewMode } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
24
26
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
25
27
|
import { assertType } from 'vscode/vscode/vs/base/common/types';
|
|
26
28
|
import { getWorkspaceSymbols } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
|
|
29
|
+
import { SearchCommandIds } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
|
|
27
30
|
import './searchActionsCopy.js';
|
|
28
31
|
import 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsFind';
|
|
29
32
|
import './searchActionsNav.js';
|
|
@@ -48,7 +51,7 @@ const viewContainer = ( (Registry.as(Extensions.ViewContainersRegistry))).regist
|
|
|
48
51
|
hideIfEmpty: true,
|
|
49
52
|
icon: searchViewIcon,
|
|
50
53
|
order: 1,
|
|
51
|
-
},
|
|
54
|
+
}, ViewContainerLocation.Sidebar, { doNotRegisterOpenCommand: true });
|
|
52
55
|
const viewDescriptor = {
|
|
53
56
|
id: VIEW_ID,
|
|
54
57
|
containerIcon: searchViewIcon,
|
|
@@ -60,7 +63,7 @@ const viewDescriptor = {
|
|
|
60
63
|
id: viewContainer.id,
|
|
61
64
|
mnemonicTitle: ( localizeWithPath(_moduleId, 1, "&&Search")),
|
|
62
65
|
keybindings: {
|
|
63
|
-
primary:
|
|
66
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyF,
|
|
64
67
|
when: ( (ContextKeyExpr.regex('neverMatch', /doesNotMatch/)))
|
|
65
68
|
},
|
|
66
69
|
order: 1
|
|
@@ -90,7 +93,7 @@ quickAccessRegistry.registerQuickAccessProvider({
|
|
|
90
93
|
prefix: SymbolsQuickAccessProvider.PREFIX,
|
|
91
94
|
placeholder: ( localizeWithPath(_moduleId, 4, "Type the name of a symbol to open.")),
|
|
92
95
|
contextKey: 'inWorkspaceSymbolsPicker',
|
|
93
|
-
helpEntries: [{ description: ( localizeWithPath(_moduleId, 5, "Go to Symbol in Workspace")), commandId:
|
|
96
|
+
helpEntries: [{ description: ( localizeWithPath(_moduleId, 5, "Go to Symbol in Workspace")), commandId: SearchCommandIds.ShowAllSymbolsActionId }]
|
|
94
97
|
});
|
|
95
98
|
quickAccessRegistry.registerQuickAccessProvider({
|
|
96
99
|
ctor: TextSearchQuickAccess,
|
|
@@ -100,7 +103,7 @@ quickAccessRegistry.registerQuickAccessProvider({
|
|
|
100
103
|
helpEntries: [
|
|
101
104
|
{
|
|
102
105
|
description: ( localizeWithPath(_moduleId, 7, "Search for Text")),
|
|
103
|
-
commandId:
|
|
106
|
+
commandId: SearchCommandIds.QuickTextSearchActionId,
|
|
104
107
|
commandCenterOrder: 25,
|
|
105
108
|
}
|
|
106
109
|
]
|
|
@@ -147,7 +150,7 @@ configurationRegistry.registerConfiguration({
|
|
|
147
150
|
}
|
|
148
151
|
]
|
|
149
152
|
},
|
|
150
|
-
scope:
|
|
153
|
+
scope: ConfigurationScope.RESOURCE
|
|
151
154
|
},
|
|
152
155
|
[SEARCH_MODE_CONFIG]: {
|
|
153
156
|
type: 'string',
|
|
@@ -208,7 +211,7 @@ configurationRegistry.registerConfiguration({
|
|
|
208
211
|
"Controls whether to use `.gitignore` and `.ignore` files when searching for files."
|
|
209
212
|
)),
|
|
210
213
|
default: true,
|
|
211
|
-
scope:
|
|
214
|
+
scope: ConfigurationScope.RESOURCE
|
|
212
215
|
},
|
|
213
216
|
'search.useGlobalIgnoreFiles': {
|
|
214
217
|
type: 'boolean',
|
|
@@ -218,7 +221,7 @@ configurationRegistry.registerConfiguration({
|
|
|
218
221
|
"Controls whether to use your global gitignore file (for example, from `$HOME/.config/git/ignore`) when searching for files. Requires `#search.useIgnoreFiles#` to be enabled."
|
|
219
222
|
)),
|
|
220
223
|
default: false,
|
|
221
|
-
scope:
|
|
224
|
+
scope: ConfigurationScope.RESOURCE
|
|
222
225
|
},
|
|
223
226
|
'search.useParentIgnoreFiles': {
|
|
224
227
|
type: 'boolean',
|
|
@@ -228,7 +231,7 @@ configurationRegistry.registerConfiguration({
|
|
|
228
231
|
"Controls whether to use `.gitignore` and `.ignore` files in parent directories when searching for files. Requires `#search.useIgnoreFiles#` to be enabled."
|
|
229
232
|
)),
|
|
230
233
|
default: false,
|
|
231
|
-
scope:
|
|
234
|
+
scope: ConfigurationScope.RESOURCE
|
|
232
235
|
},
|
|
233
236
|
'search.quickOpen.includeSymbols': {
|
|
234
237
|
type: 'boolean',
|
|
@@ -473,8 +476,8 @@ configurationRegistry.registerConfiguration({
|
|
|
473
476
|
},
|
|
474
477
|
'search.sortOrder': {
|
|
475
478
|
type: 'string',
|
|
476
|
-
enum: [
|
|
477
|
-
default:
|
|
479
|
+
enum: [SearchSortOrder.Default, SearchSortOrder.FileNames, SearchSortOrder.Type, SearchSortOrder.Modified, SearchSortOrder.CountDescending, SearchSortOrder.CountAscending],
|
|
480
|
+
default: SearchSortOrder.Default,
|
|
478
481
|
enumDescriptions: [
|
|
479
482
|
( localizeWithPath(
|
|
480
483
|
_moduleId,
|
|
@@ -525,8 +528,8 @@ configurationRegistry.registerConfiguration({
|
|
|
525
528
|
},
|
|
526
529
|
'search.defaultViewMode': {
|
|
527
530
|
type: 'string',
|
|
528
|
-
enum: [
|
|
529
|
-
default:
|
|
531
|
+
enum: [ViewMode.Tree, ViewMode.List],
|
|
532
|
+
default: ViewMode.List,
|
|
530
533
|
enumDescriptions: [
|
|
531
534
|
( localizeWithPath(_moduleId, 65, "Shows search results as a tree.")),
|
|
532
535
|
( localizeWithPath(_moduleId, 66, "Shows search results as a list."))
|
|
@@ -2,9 +2,11 @@ import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
|
2
2
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
3
3
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
4
4
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
5
|
-
import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
|
|
5
|
+
import { SearchCommandIds, SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
|
|
6
6
|
import { FileMatch, FolderMatchWithResource, Match, FolderMatch, searchMatchComparer } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
|
|
7
7
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
8
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
9
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
8
10
|
import { category, getSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
|
|
9
11
|
import { isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
10
12
|
|
|
@@ -12,13 +14,13 @@ const _moduleId = "vs/workbench/contrib/search/browser/searchActionsCopy";
|
|
|
12
14
|
registerAction2(class CopyMatchCommandAction extends Action2 {
|
|
13
15
|
constructor() {
|
|
14
16
|
super({
|
|
15
|
-
id:
|
|
17
|
+
id: SearchCommandIds.CopyMatchCommandId,
|
|
16
18
|
title: ( localize2WithPath(_moduleId, 0, "Copy")),
|
|
17
19
|
category,
|
|
18
20
|
keybinding: {
|
|
19
|
-
weight:
|
|
21
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
20
22
|
when: SearchContext.FileMatchOrMatchFocusKey,
|
|
21
|
-
primary:
|
|
23
|
+
primary: KeyMod.CtrlCmd | KeyCode.KeyC,
|
|
22
24
|
},
|
|
23
25
|
menu: [{
|
|
24
26
|
id: MenuId.SearchContext,
|
|
@@ -35,15 +37,15 @@ registerAction2(class CopyMatchCommandAction extends Action2 {
|
|
|
35
37
|
registerAction2(class CopyPathCommandAction extends Action2 {
|
|
36
38
|
constructor() {
|
|
37
39
|
super({
|
|
38
|
-
id:
|
|
40
|
+
id: SearchCommandIds.CopyPathCommandId,
|
|
39
41
|
title: ( localize2WithPath(_moduleId, 1, "Copy Path")),
|
|
40
42
|
category,
|
|
41
43
|
keybinding: {
|
|
42
|
-
weight:
|
|
44
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
43
45
|
when: SearchContext.FileMatchOrFolderMatchWithResourceFocusKey,
|
|
44
|
-
primary:
|
|
46
|
+
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC,
|
|
45
47
|
win: {
|
|
46
|
-
primary:
|
|
48
|
+
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KeyC
|
|
47
49
|
},
|
|
48
50
|
},
|
|
49
51
|
menu: [{
|
|
@@ -61,7 +63,7 @@ registerAction2(class CopyPathCommandAction extends Action2 {
|
|
|
61
63
|
registerAction2(class CopyAllCommandAction extends Action2 {
|
|
62
64
|
constructor() {
|
|
63
65
|
super({
|
|
64
|
-
id:
|
|
66
|
+
id: SearchCommandIds.CopyAllCommandId,
|
|
65
67
|
title: ( localize2WithPath(_moduleId, 2, "Copy All")),
|
|
66
68
|
category,
|
|
67
69
|
menu: [{
|
|
@@ -2,7 +2,7 @@ import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
|
2
2
|
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
4
4
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
5
|
-
import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
|
|
5
|
+
import { SearchCommandIds, SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
|
|
6
6
|
import { InSearchEditor } from 'vscode/vscode/vs/workbench/contrib/searchEditor/browser/constants';
|
|
7
7
|
import { FolderMatch } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
|
|
8
8
|
import { SearchEditorInput } from '../../searchEditor/browser/searchEditorInput.js';
|
|
@@ -11,6 +11,8 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
|
|
|
11
11
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
12
12
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
13
13
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
14
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
15
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
14
16
|
import { ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding, TogglePreserveCaseKeybinding } from 'vscode/vscode/vs/editor/contrib/find/browser/findModel';
|
|
15
17
|
import { category, getSearchView, openSearchView } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchActionsBase';
|
|
16
18
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
@@ -20,13 +22,13 @@ const _moduleId = "vs/workbench/contrib/search/browser/searchActionsNav";
|
|
|
20
22
|
registerAction2(class ToggleQueryDetailsAction extends Action2 {
|
|
21
23
|
constructor() {
|
|
22
24
|
super({
|
|
23
|
-
id:
|
|
25
|
+
id: SearchCommandIds.ToggleQueryDetailsActionId,
|
|
24
26
|
title: ( localize2WithPath(_moduleId, 0, "Toggle Query Details")),
|
|
25
27
|
category,
|
|
26
28
|
keybinding: {
|
|
27
|
-
weight:
|
|
29
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
28
30
|
when: ( (ContextKeyExpr.or(SearchContext.SearchViewFocusedKey, InSearchEditor))),
|
|
29
|
-
primary:
|
|
31
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyJ,
|
|
30
32
|
},
|
|
31
33
|
});
|
|
32
34
|
}
|
|
@@ -44,16 +46,16 @@ registerAction2(class ToggleQueryDetailsAction extends Action2 {
|
|
|
44
46
|
registerAction2(class CloseReplaceAction extends Action2 {
|
|
45
47
|
constructor() {
|
|
46
48
|
super({
|
|
47
|
-
id:
|
|
49
|
+
id: SearchCommandIds.CloseReplaceWidgetActionId,
|
|
48
50
|
title: ( localize2WithPath(_moduleId, 1, "Close Replace Widget")),
|
|
49
51
|
category,
|
|
50
52
|
keybinding: {
|
|
51
|
-
weight:
|
|
53
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
52
54
|
when: ( (ContextKeyExpr.and(
|
|
53
55
|
SearchContext.SearchViewVisibleKey,
|
|
54
56
|
SearchContext.ReplaceInputBoxFocusedKey
|
|
55
57
|
))),
|
|
56
|
-
primary:
|
|
58
|
+
primary: KeyCode.Escape,
|
|
57
59
|
},
|
|
58
60
|
});
|
|
59
61
|
}
|
|
@@ -69,11 +71,11 @@ registerAction2(class CloseReplaceAction extends Action2 {
|
|
|
69
71
|
registerAction2(class ToggleCaseSensitiveCommandAction extends Action2 {
|
|
70
72
|
constructor() {
|
|
71
73
|
super({
|
|
72
|
-
id:
|
|
74
|
+
id: SearchCommandIds.ToggleCaseSensitiveCommandId,
|
|
73
75
|
title: ( localize2WithPath(_moduleId, 2, "Toggle Case Sensitive")),
|
|
74
76
|
category,
|
|
75
77
|
keybinding: Object.assign({
|
|
76
|
-
weight:
|
|
78
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
77
79
|
when: isMacintosh ? ( (ContextKeyExpr.and(
|
|
78
80
|
SearchContext.SearchViewFocusedKey,
|
|
79
81
|
(SearchContext.FileMatchOrFolderMatchFocusKey.toNegated())
|
|
@@ -88,10 +90,10 @@ registerAction2(class ToggleCaseSensitiveCommandAction extends Action2 {
|
|
|
88
90
|
registerAction2(class ToggleWholeWordCommandAction extends Action2 {
|
|
89
91
|
constructor() {
|
|
90
92
|
super({
|
|
91
|
-
id:
|
|
93
|
+
id: SearchCommandIds.ToggleWholeWordCommandId,
|
|
92
94
|
title: ( localize2WithPath(_moduleId, 3, "Toggle Whole Word")),
|
|
93
95
|
keybinding: Object.assign({
|
|
94
|
-
weight:
|
|
96
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
95
97
|
when: SearchContext.SearchViewFocusedKey,
|
|
96
98
|
}, ToggleWholeWordKeybinding),
|
|
97
99
|
category,
|
|
@@ -104,10 +106,10 @@ registerAction2(class ToggleWholeWordCommandAction extends Action2 {
|
|
|
104
106
|
registerAction2(class ToggleRegexCommandAction extends Action2 {
|
|
105
107
|
constructor() {
|
|
106
108
|
super({
|
|
107
|
-
id:
|
|
109
|
+
id: SearchCommandIds.ToggleRegexCommandId,
|
|
108
110
|
title: ( localize2WithPath(_moduleId, 4, "Toggle Regex")),
|
|
109
111
|
keybinding: Object.assign({
|
|
110
|
-
weight:
|
|
112
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
111
113
|
when: SearchContext.SearchViewFocusedKey,
|
|
112
114
|
}, ToggleRegexKeybinding),
|
|
113
115
|
category,
|
|
@@ -120,10 +122,10 @@ registerAction2(class ToggleRegexCommandAction extends Action2 {
|
|
|
120
122
|
registerAction2(class TogglePreserveCaseAction extends Action2 {
|
|
121
123
|
constructor() {
|
|
122
124
|
super({
|
|
123
|
-
id:
|
|
125
|
+
id: SearchCommandIds.TogglePreserveCaseId,
|
|
124
126
|
title: ( localize2WithPath(_moduleId, 5, "Toggle Preserve Case")),
|
|
125
127
|
keybinding: Object.assign({
|
|
126
|
-
weight:
|
|
128
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
127
129
|
when: SearchContext.SearchViewFocusedKey,
|
|
128
130
|
}, TogglePreserveCaseKeybinding),
|
|
129
131
|
category,
|
|
@@ -136,16 +138,16 @@ registerAction2(class TogglePreserveCaseAction extends Action2 {
|
|
|
136
138
|
registerAction2(class OpenMatchAction extends Action2 {
|
|
137
139
|
constructor() {
|
|
138
140
|
super({
|
|
139
|
-
id:
|
|
141
|
+
id: SearchCommandIds.OpenMatch,
|
|
140
142
|
title: ( localize2WithPath(_moduleId, 6, "Open Match")),
|
|
141
143
|
category,
|
|
142
144
|
keybinding: {
|
|
143
|
-
weight:
|
|
145
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
144
146
|
when: ( (ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, SearchContext.FileMatchOrMatchFocusKey))),
|
|
145
|
-
primary:
|
|
147
|
+
primary: KeyCode.Enter,
|
|
146
148
|
mac: {
|
|
147
|
-
primary:
|
|
148
|
-
secondary: [
|
|
149
|
+
primary: KeyCode.Enter,
|
|
150
|
+
secondary: [KeyMod.CtrlCmd | KeyCode.DownArrow]
|
|
149
151
|
},
|
|
150
152
|
},
|
|
151
153
|
});
|
|
@@ -168,15 +170,15 @@ registerAction2(class OpenMatchAction extends Action2 {
|
|
|
168
170
|
registerAction2(class OpenMatchToSideAction extends Action2 {
|
|
169
171
|
constructor() {
|
|
170
172
|
super({
|
|
171
|
-
id:
|
|
173
|
+
id: SearchCommandIds.OpenMatchToSide,
|
|
172
174
|
title: ( localize2WithPath(_moduleId, 7, "Open Match To Side")),
|
|
173
175
|
category,
|
|
174
176
|
keybinding: {
|
|
175
|
-
weight:
|
|
177
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
176
178
|
when: ( (ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, SearchContext.FileMatchOrMatchFocusKey))),
|
|
177
|
-
primary:
|
|
179
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
178
180
|
mac: {
|
|
179
|
-
primary:
|
|
181
|
+
primary: KeyMod.WinCtrl | KeyCode.Enter
|
|
180
182
|
},
|
|
181
183
|
},
|
|
182
184
|
});
|
|
@@ -192,12 +194,12 @@ registerAction2(class OpenMatchToSideAction extends Action2 {
|
|
|
192
194
|
registerAction2(class AddCursorsAtSearchResultsAction extends Action2 {
|
|
193
195
|
constructor() {
|
|
194
196
|
super({
|
|
195
|
-
id:
|
|
197
|
+
id: SearchCommandIds.AddCursorsAtSearchResults,
|
|
196
198
|
title: ( localize2WithPath(_moduleId, 8, "Add Cursors at Search Results")),
|
|
197
199
|
keybinding: {
|
|
198
|
-
weight:
|
|
200
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
199
201
|
when: ( (ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, SearchContext.FileMatchOrMatchFocusKey))),
|
|
200
|
-
primary:
|
|
202
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyL,
|
|
201
203
|
},
|
|
202
204
|
category,
|
|
203
205
|
});
|
|
@@ -213,16 +215,16 @@ registerAction2(class AddCursorsAtSearchResultsAction extends Action2 {
|
|
|
213
215
|
registerAction2(class FocusNextInputAction extends Action2 {
|
|
214
216
|
constructor() {
|
|
215
217
|
super({
|
|
216
|
-
id:
|
|
218
|
+
id: SearchCommandIds.FocusNextInputActionId,
|
|
217
219
|
title: ( localize2WithPath(_moduleId, 9, "Focus Next Input")),
|
|
218
220
|
category,
|
|
219
221
|
keybinding: {
|
|
220
|
-
weight:
|
|
222
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
221
223
|
when: ( (ContextKeyExpr.or(
|
|
222
224
|
(ContextKeyExpr.and(InSearchEditor, SearchContext.InputBoxFocusedKey)),
|
|
223
225
|
(ContextKeyExpr.and(SearchContext.SearchViewVisibleKey, SearchContext.InputBoxFocusedKey))
|
|
224
226
|
))),
|
|
225
|
-
primary:
|
|
227
|
+
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
|
|
226
228
|
},
|
|
227
229
|
});
|
|
228
230
|
}
|
|
@@ -239,11 +241,11 @@ registerAction2(class FocusNextInputAction extends Action2 {
|
|
|
239
241
|
registerAction2(class FocusPreviousInputAction extends Action2 {
|
|
240
242
|
constructor() {
|
|
241
243
|
super({
|
|
242
|
-
id:
|
|
244
|
+
id: SearchCommandIds.FocusPreviousInputActionId,
|
|
243
245
|
title: ( localize2WithPath(_moduleId, 10, "Focus Previous Input")),
|
|
244
246
|
category,
|
|
245
247
|
keybinding: {
|
|
246
|
-
weight:
|
|
248
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
247
249
|
when: ( (ContextKeyExpr.or(
|
|
248
250
|
(ContextKeyExpr.and(InSearchEditor, SearchContext.InputBoxFocusedKey)),
|
|
249
251
|
(ContextKeyExpr.and(
|
|
@@ -252,7 +254,7 @@ registerAction2(class FocusPreviousInputAction extends Action2 {
|
|
|
252
254
|
(SearchContext.SearchInputBoxFocusedKey.toNegated())
|
|
253
255
|
))
|
|
254
256
|
))),
|
|
255
|
-
primary:
|
|
257
|
+
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
|
256
258
|
},
|
|
257
259
|
});
|
|
258
260
|
}
|
|
@@ -269,16 +271,16 @@ registerAction2(class FocusPreviousInputAction extends Action2 {
|
|
|
269
271
|
registerAction2(class FocusSearchFromResultsAction extends Action2 {
|
|
270
272
|
constructor() {
|
|
271
273
|
super({
|
|
272
|
-
id:
|
|
274
|
+
id: SearchCommandIds.FocusSearchFromResults,
|
|
273
275
|
title: ( localize2WithPath(_moduleId, 11, "Focus Search From Results")),
|
|
274
276
|
category,
|
|
275
277
|
keybinding: {
|
|
276
|
-
weight:
|
|
278
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
277
279
|
when: ( (ContextKeyExpr.and(
|
|
278
280
|
SearchContext.SearchViewVisibleKey,
|
|
279
281
|
(ContextKeyExpr.or(SearchContext.FirstMatchFocusKey, CONTEXT_ACCESSIBILITY_MODE_ENABLED))
|
|
280
282
|
))),
|
|
281
|
-
primary:
|
|
283
|
+
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
|
282
284
|
},
|
|
283
285
|
});
|
|
284
286
|
}
|
|
@@ -291,7 +293,7 @@ registerAction2(class ToggleSearchOnTypeAction extends Action2 {
|
|
|
291
293
|
static { this.searchOnTypeKey = 'search.searchOnType'; }
|
|
292
294
|
constructor() {
|
|
293
295
|
super({
|
|
294
|
-
id:
|
|
296
|
+
id: SearchCommandIds.ToggleSearchOnTypeActionId,
|
|
295
297
|
title: ( localize2WithPath(_moduleId, 12, "Toggle Search on Type")),
|
|
296
298
|
category,
|
|
297
299
|
});
|
|
@@ -305,7 +307,7 @@ registerAction2(class ToggleSearchOnTypeAction extends Action2 {
|
|
|
305
307
|
registerAction2(class FocusSearchListCommandAction extends Action2 {
|
|
306
308
|
constructor() {
|
|
307
309
|
super({
|
|
308
|
-
id:
|
|
310
|
+
id: SearchCommandIds.FocusSearchListCommandID,
|
|
309
311
|
title: ( localize2WithPath(_moduleId, 13, "Focus List")),
|
|
310
312
|
category,
|
|
311
313
|
f1: true
|
|
@@ -318,11 +320,11 @@ registerAction2(class FocusSearchListCommandAction extends Action2 {
|
|
|
318
320
|
registerAction2(class FocusNextSearchResultAction extends Action2 {
|
|
319
321
|
constructor() {
|
|
320
322
|
super({
|
|
321
|
-
id:
|
|
323
|
+
id: SearchCommandIds.FocusNextSearchResultActionId,
|
|
322
324
|
title: ( localize2WithPath(_moduleId, 14, "Focus Next Search Result")),
|
|
323
325
|
keybinding: [{
|
|
324
|
-
primary:
|
|
325
|
-
weight:
|
|
326
|
+
primary: KeyCode.F4,
|
|
327
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
326
328
|
}],
|
|
327
329
|
category,
|
|
328
330
|
f1: true,
|
|
@@ -336,11 +338,11 @@ registerAction2(class FocusNextSearchResultAction extends Action2 {
|
|
|
336
338
|
registerAction2(class FocusPreviousSearchResultAction extends Action2 {
|
|
337
339
|
constructor() {
|
|
338
340
|
super({
|
|
339
|
-
id:
|
|
341
|
+
id: SearchCommandIds.FocusPreviousSearchResultActionId,
|
|
340
342
|
title: ( localize2WithPath(_moduleId, 15, "Focus Previous Search Result")),
|
|
341
343
|
keybinding: [{
|
|
342
|
-
primary:
|
|
343
|
-
weight:
|
|
344
|
+
primary: KeyMod.Shift | KeyCode.F4,
|
|
345
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
344
346
|
}],
|
|
345
347
|
category,
|
|
346
348
|
f1: true,
|
|
@@ -354,11 +356,11 @@ registerAction2(class FocusPreviousSearchResultAction extends Action2 {
|
|
|
354
356
|
registerAction2(class ReplaceInFilesAction extends Action2 {
|
|
355
357
|
constructor() {
|
|
356
358
|
super({
|
|
357
|
-
id:
|
|
359
|
+
id: SearchCommandIds.ReplaceInFilesActionId,
|
|
358
360
|
title: ( localize2WithPath(_moduleId, 16, "Replace in Files")),
|
|
359
361
|
keybinding: [{
|
|
360
|
-
primary:
|
|
361
|
-
weight:
|
|
362
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyH,
|
|
363
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
362
364
|
}],
|
|
363
365
|
category,
|
|
364
366
|
f1: true,
|