diff --git a/packages/codemirror-extension/src/index.ts b/packages/codemirror-extension/src/index.ts index 22c7acbe0553..5a89de742162 100644 --- a/packages/codemirror-extension/src/index.ts +++ b/packages/codemirror-extension/src/index.ts @@ -42,8 +42,6 @@ namespace CommandIDs { export const find = 'codemirror:find'; - export const findAndReplace = 'codemirror:find-and-replace'; - export const goToLine = 'codemirror:go-to-line'; } @@ -284,19 +282,6 @@ function activateEditorCommands( isEnabled }); - commands.addCommand(CommandIDs.findAndReplace, { - label: 'Find and Replace...', - execute: () => { - let widget = tracker.currentWidget; - if (!widget) { - return; - } - let editor = widget.content.editor as CodeMirrorEditor; - editor.execCommand('replace'); - }, - isEnabled - }); - commands.addCommand(CommandIDs.goToLine, { label: 'Go to Line...', execute: () => { @@ -395,15 +380,6 @@ function activateEditorCommands( // Add the syntax highlighting submenu to the `View` menu. mainMenu.viewMenu.addGroup([{ type: 'submenu', submenu: modeMenu }], 40); - // Add find-replace capabilities to the edit menu. - mainMenu.editMenu.findReplacers.add({ - tracker, - findAndReplace: (widget: IDocumentWidget) => { - let editor = widget.content.editor as CodeMirrorEditor; - editor.execCommand('replace'); - } - } as IEditMenu.IFindReplacer>); - // Add go to line capabilities to the edit menu. mainMenu.editMenu.goToLiners.add({ tracker, diff --git a/packages/mainmenu-extension/src/index.ts b/packages/mainmenu-extension/src/index.ts index 5ec7a2842199..34fef724b4c0 100644 --- a/packages/mainmenu-extension/src/index.ts +++ b/packages/mainmenu-extension/src/index.ts @@ -51,8 +51,6 @@ export namespace CommandIDs { export const find = 'editmenu:find'; - export const findAndReplace = 'editmenu:find-and-replace'; - export const goToLine = 'editmenu:go-to-line'; export const openFile = 'filemenu:open'; @@ -280,20 +278,6 @@ export function createEditMenu(app: JupyterFrontEnd, menu: EditMenu): void { 10 ); - // Add the find-replace command to the Edit menu. - commands.addCommand(CommandIDs.findAndReplace, { - label: 'Find and Replace…', - isEnabled: Private.delegateEnabled( - app, - menu.findReplacers, - 'findAndReplace' - ), - execute: Private.delegateExecute(app, menu.findReplacers, 'findAndReplace') - }); - menu.addGroup( - [{ command: CommandIDs.find }, { command: CommandIDs.findAndReplace }], - 200 - ); commands.addCommand(CommandIDs.goToLine, { label: 'Go to Line…', isEnabled: Private.delegateEnabled(app, menu.goToLiners, 'goToLine'), diff --git a/packages/mainmenu/src/edit.ts b/packages/mainmenu/src/edit.ts index 52d415645352..c8013a32f05a 100644 --- a/packages/mainmenu/src/edit.ts +++ b/packages/mainmenu/src/edit.ts @@ -19,11 +19,6 @@ export interface IEditMenu extends IJupyterLabMenu { */ readonly clearers: Set>; - /** - * A set storing IFindReplacers for the Edit menu. - */ - readonly findReplacers: Set>; - /** * A set storing IGoToLiners for the Edit menu. */ @@ -45,8 +40,6 @@ export class EditMenu extends JupyterLabMenu implements IEditMenu { this.clearers = new Set>(); - this.findReplacers = new Set>(); - this.goToLiners = new Set>(); } @@ -60,11 +53,6 @@ export class EditMenu extends JupyterLabMenu implements IEditMenu { */ readonly clearers: Set>; - /** - * A set storing IFindReplacers for the Edit menu. - */ - readonly findReplacers: Set>; - /** * A set storing IGoToLiners for the Edit menu. */ @@ -76,7 +64,6 @@ export class EditMenu extends JupyterLabMenu implements IEditMenu { dispose(): void { this.undoers.clear(); this.clearers.clear(); - this.findReplacers.clear(); super.dispose(); } } @@ -125,16 +112,6 @@ export namespace IEditMenu { clearAll?: (widget: T) => void; } - /** - * Interface for an activity that uses Find/Find+Replace. - */ - export interface IFindReplacer extends IMenuExtender { - /** - * Execute a find/replace command for the activity. - */ - findAndReplace?: (widget: T) => void; - } - /** * Interface for an activity that uses Go to Line. */ diff --git a/tests/test-mainmenu/src/edit.spec.ts b/tests/test-mainmenu/src/edit.spec.ts index 29bb40d27e09..9a35259e374e 100644 --- a/tests/test-mainmenu/src/edit.spec.ts +++ b/tests/test-mainmenu/src/edit.spec.ts @@ -90,20 +90,5 @@ describe('@jupyterlab/mainmenu', () => { expect(wodget.state).to.equal('clearAll'); }); }); - - describe('#findReplacers', () => { - it('should allow setting of an IFindReplacer', () => { - const finder: IEditMenu.IFindReplacer = { - tracker, - findAndReplace: widget => { - widget.state = 'findAndReplace'; - return; - } - }; - menu.findReplacers.add(finder); - void delegateExecute(wodget, menu.findReplacers, 'findAndReplace'); - expect(wodget.state).to.equal('findAndReplace'); - }); - }); }); });