@@ -8,9 +8,10 @@ import * as objects from 'vs/base/common/objects';
88import { endsWith } from 'vs/base/common/strings' ;
99import { URI } from 'vs/base/common/uri' ;
1010import { ServicesAccessor } from 'vs/editor/browser/editorExtensions' ;
11+ import { Range } from 'vs/editor/common/core/range' ;
1112import { ToggleCaseSensitiveKeybinding , ToggleRegexKeybinding , ToggleWholeWordKeybinding } from 'vs/editor/contrib/find/findModel' ;
1213import { localize } from 'vs/nls' ;
13- import { MenuId , SyncActionDescriptor , registerAction2 , Action2 } from 'vs/platform/actions/common/actions' ;
14+ import { Action2 , MenuId , registerAction2 } from 'vs/platform/actions/common/actions' ;
1415import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
1516import { ContextKeyExpr , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
1617import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' ;
@@ -20,20 +21,18 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
2021import { Registry } from 'vs/platform/registry/common/platform' ;
2122import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
2223import { EditorDescriptor , Extensions as EditorExtensions , IEditorRegistry } from 'vs/workbench/browser/editor' ;
23- import { Extensions as ActionExtensions , IWorkbenchActionRegistry } from 'vs/workbench/common/actions' ;
2424import { Extensions as WorkbenchExtensions , IWorkbenchContribution , IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions' ;
25- import { Extensions as EditorInputExtensions , IEditorInputFactory , IEditorInputFactoryRegistry , ActiveEditorContext } from 'vs/workbench/common/editor' ;
25+ import { ActiveEditorContext , Extensions as EditorInputExtensions , IEditorInputFactory , IEditorInputFactoryRegistry } from 'vs/workbench/common/editor' ;
26+ import { IViewsService } from 'vs/workbench/common/views' ;
27+ import { getSearchView } from 'vs/workbench/contrib/search/browser/searchActions' ;
28+ import { searchRefreshIcon } from 'vs/workbench/contrib/search/browser/searchIcons' ;
2629import * as SearchConstants from 'vs/workbench/contrib/search/common/constants' ;
2730import * as SearchEditorConstants from 'vs/workbench/contrib/searchEditor/browser/constants' ;
2831import { SearchEditor } from 'vs/workbench/contrib/searchEditor/browser/searchEditor' ;
29- import { modifySearchEditorContextLinesCommand , OpenSearchEditorAction , selectAllSearchEditorMatchesCommand , toggleSearchEditorCaseSensitiveCommand , toggleSearchEditorContextLinesCommand , toggleSearchEditorRegexCommand , toggleSearchEditorWholeWordCommand , createEditorFromSearchResult , openNewSearchEditor } from 'vs/workbench/contrib/searchEditor/browser/searchEditorActions' ;
30- import { getOrMakeSearchEditorInput , SearchEditorInput , SearchConfiguration } from 'vs/workbench/contrib/searchEditor/browser/searchEditorInput' ;
31- import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
32+ import { createEditorFromSearchResult , modifySearchEditorContextLinesCommand , openNewSearchEditor , selectAllSearchEditorMatchesCommand , toggleSearchEditorCaseSensitiveCommand , toggleSearchEditorContextLinesCommand , toggleSearchEditorRegexCommand , toggleSearchEditorWholeWordCommand } from 'vs/workbench/contrib/searchEditor/browser/searchEditorActions' ;
33+ import { getOrMakeSearchEditorInput , SearchConfiguration , SearchEditorInput } from 'vs/workbench/contrib/searchEditor/browser/searchEditorInput' ;
3234import { parseSavedSearchEditor } from 'vs/workbench/contrib/searchEditor/browser/searchEditorSerialization' ;
33- import { Range } from 'vs/editor/common/core/range' ;
34- import { searchRefreshIcon } from 'vs/workbench/contrib/search/browser/searchIcons' ;
35- import { IViewsService } from 'vs/workbench/common/views' ;
36- import { getSearchView } from 'vs/workbench/contrib/search/browser/searchActions' ;
35+ import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
3736
3837
3938const OpenInEditorCommandId = 'search.action.openInEditor' ;
@@ -210,13 +209,35 @@ CommandsRegistry.registerCommand(
210209//#endregion
211210
212211//#region Actions
213- const registry = Registry . as < IWorkbenchActionRegistry > ( ActionExtensions . WorkbenchActions ) ;
214212const category = localize ( 'search' , "Search Editor" ) ;
215213
216- // TODO: Not an action2 becuase used in view pane container action bar, which uses actions
217- registry . registerWorkbenchAction (
218- SyncActionDescriptor . from ( OpenSearchEditorAction ) ,
219- 'Search Editor: Open New Search Editor' , category ) ;
214+ registerAction2 ( class extends Action2 {
215+ constructor ( ) {
216+ super ( {
217+ id : SearchEditorConstants . OpenNewEditorCommandId ,
218+ title : localize ( 'search.openNewSearchEditor' , "Open new Search Editor" ) ,
219+ category,
220+ f1 : true ,
221+ } ) ;
222+ }
223+ async run ( accessor : ServicesAccessor , args : Partial < SearchConfiguration > ) {
224+ await accessor . get ( IInstantiationService ) . invokeFunction ( openNewSearchEditor , args ) ;
225+ }
226+ } ) ;
227+
228+ registerAction2 ( class extends Action2 {
229+ constructor ( ) {
230+ super ( {
231+ id : OpenNewEditorToSideCommandId ,
232+ title : localize ( 'search.openNewEditorToSide' , "Open new Search Editor to the Side" ) ,
233+ category,
234+ f1 : true ,
235+ } ) ;
236+ }
237+ async run ( accessor : ServicesAccessor , args : Partial < SearchConfiguration > ) {
238+ await accessor . get ( IInstantiationService ) . invokeFunction ( openNewSearchEditor , args , true ) ;
239+ }
240+ } ) ;
220241
221242registerAction2 ( class extends Action2 {
222243 constructor ( ) {
@@ -242,21 +263,6 @@ registerAction2(class extends Action2 {
242263 }
243264} ) ;
244265
245- registerAction2 ( class extends Action2 {
246- constructor ( ) {
247- super ( {
248- id : OpenNewEditorToSideCommandId ,
249- title : localize ( 'search.openNewEditorToSide' , "Open New Search Editor to Side" ) ,
250- category,
251- f1 : true ,
252- } ) ;
253- }
254- async run ( accessor : ServicesAccessor ) {
255- const instantiationService = accessor . get ( IInstantiationService ) ;
256- await instantiationService . invokeFunction ( openNewSearchEditor , true ) ;
257- }
258- } ) ;
259-
260266registerAction2 ( class extends Action2 {
261267 constructor ( ) {
262268 super ( {
0 commit comments