code: def register_plugin(self):
          
          self.profiler.datatree.sig_edit_goto.connect(self.main.editor.load)
          self.profiler.redirect_stdio.connect(
              self.main.redirect_internalshell_stdio)
          self.main.add_dockwidget(self)
  
          profiler_act = create_action(self, _("Profile"),
                                       icon=self.get_plugin_icon(),
                                       triggered=self.run_profiler)
          profiler_act.setEnabled(is_profiler_installed())
          self.register_shortcut(profiler_act, context="Profiler",
                                 name="Run profiler")
          
          self.main.run_menu_actions += [profiler_act]
          self.main.editor.pythonfile_dependent_actions += [profiler_act]
docs: Register plugin in Spyder's main window