@@ -12,15 +12,10 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
1212import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
1313import { Command , ICommandOptions } from 'vs/editor/browser/editorExtensions' ;
1414import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
15- import { KeyMod , KeyCode } from 'vs/base/common/keyCodes' ;
16- import { ContextKeyExpr , IContextKey , RawContextKey , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
17- import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
15+ import { IContextKey , RawContextKey , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
1816
1917import { Webview } from './webview' ;
2018import { Builder } from 'vs/base/browser/builder' ;
21- import { IWorkbenchActionRegistry , Extensions as ActionExtensions } from 'vs/workbench/common/actions' ;
22- import { Registry } from 'vs/platform/registry/common/platform' ;
23- import { SyncActionDescriptor } from 'vs/platform/actions/common/actions' ;
2419import { Action } from 'vs/base/common/actions' ;
2520import { TPromise } from 'vs/base/common/winjs.base' ;
2621
@@ -98,7 +93,7 @@ export abstract class WebviewEditor extends BaseWebviewEditor {
9893 protected abstract createEditor ( parent : Builder ) : void ;
9994}
10095
101- class ShowWebViewEditorFindWidgetAction extends Action {
96+ export class ShowWebViewEditorFindWidgetAction extends Action {
10297 public static readonly ID = 'editor.action.webvieweditor.showFind' ;
10398 public static readonly LABEL = nls . localize ( 'editor.action.webvieweditor.showFind' , "Focus Find Widget" ) ;
10499
@@ -127,15 +122,7 @@ class ShowWebViewEditorFindWidgetAction extends Action {
127122 }
128123}
129124
130- const category = 'Webview' ;
131- let actionRegistry = < IWorkbenchActionRegistry > Registry . as ( ActionExtensions . WorkbenchActions ) ;
132-
133- actionRegistry . registerWorkbenchAction ( new SyncActionDescriptor ( ShowWebViewEditorFindWidgetAction , ShowWebViewEditorFindWidgetAction . ID , ShowWebViewEditorFindWidgetAction . LABEL , {
134- primary : KeyMod . CtrlCmd | KeyCode . KEY_F
135- } , KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS ) ,
136- 'Webview: Focus Find Widget' , category ) ;
137-
138- class HideWebViewEditorFindCommand extends Command {
125+ export class HideWebViewEditorFindCommand extends Command {
139126 public runCommand ( accessor : ServicesAccessor , args : any ) : void {
140127 const webViewEditor = this . getWebViewEditor ( accessor ) ;
141128 if ( webViewEditor ) {
@@ -151,18 +138,8 @@ class HideWebViewEditorFindCommand extends Command {
151138 return null ;
152139 }
153140}
154- const hideCommand = new HideWebViewEditorFindCommand ( {
155- id : 'editor.action.webvieweditor.hideFind' ,
156- precondition : ContextKeyExpr . and (
157- KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS ,
158- KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE ) ,
159- kbOpts : {
160- primary : KeyCode . Escape
161- }
162- } ) ;
163- KeybindingsRegistry . registerCommandAndKeybindingRule ( hideCommand . toCommandAndKeybindingRule ( KeybindingsRegistry . WEIGHT . editorContrib ( ) ) ) ;
164141
165- class ShowWebViewEditorFindTermCommand extends Command {
142+ export class ShowWebViewEditorFindTermCommand extends Command {
166143 constructor ( opts : ICommandOptions , private _next : boolean ) {
167144 super ( opts ) ;
168145 }
@@ -186,21 +163,3 @@ class ShowWebViewEditorFindTermCommand extends Command {
186163 return null ;
187164 }
188165}
189-
190- const showNextFindTermCommand = new ShowWebViewEditorFindTermCommand ( {
191- id : 'editor.action.webvieweditor.showNextFindTerm' ,
192- precondition : KEYBINDING_CONTEXT_WEBVIEWEDITOR_FIND_WIDGET_INPUT_FOCUSED ,
193- kbOpts : {
194- primary : KeyMod . Alt | KeyCode . DownArrow
195- }
196- } , true ) ;
197- KeybindingsRegistry . registerCommandAndKeybindingRule ( showNextFindTermCommand . toCommandAndKeybindingRule ( KeybindingsRegistry . WEIGHT . editorContrib ( ) ) ) ;
198-
199- const showPreviousFindTermCommand = new ShowWebViewEditorFindTermCommand ( {
200- id : 'editor.action.webvieweditor.showPreviousFindTerm' ,
201- precondition : KEYBINDING_CONTEXT_WEBVIEWEDITOR_FIND_WIDGET_INPUT_FOCUSED ,
202- kbOpts : {
203- primary : KeyMod . Alt | KeyCode . UpArrow
204- }
205- } , false ) ;
206- KeybindingsRegistry . registerCommandAndKeybindingRule ( showPreviousFindTermCommand . toCommandAndKeybindingRule ( KeybindingsRegistry . WEIGHT . editorContrib ( ) ) ) ;
0 commit comments