Search code examples
javascriptmonaco-editor

Show replace panel on click monaco editor


I'm creating an app using monaco-editor. I wanna show the replace panel when I click on a button. I searched a lot but I didn't find what I wanted. I tried that :

  window.editor.focus();
  window.editor.getAction('actions.replace').run()

but it didn't work.


Solution

  • To get the replace panel use the action editor.action.startFindReplaceAction.

    editor.getAction('editor.action.startFindReplaceAction').run()
    

    If you want list of all the actions available then use the method editor.getActions() which will give the list of all available actions.