MCPcopy Create free account
hub / github.com/SpartanJ/eepp / initPluginManager

Method initPluginManager

src/tools/ecode/ecode.cpp:781–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779}
780
781void App::initPluginManager() {
782 mPluginManager = std::make_unique<PluginManager>(
783 mResPath, mPluginsPath, mConfigPath, mThreadPool,
784 [this]( const std::string& path, const auto& cb ) {
785 UITab* tab = mSplitter->isDocumentOpen( path );
786 if ( !tab ) {
787 loadFileFromPath( path, true, nullptr, cb );
788 } else {
789 tab->getTabWidget()->setTabSelected( tab );
790 cb( tab->getOwnedWidget()->asType<UICodeEditor>(), path );
791 }
792 },
793 this );
794 mPluginManager->onPluginEnabled = [this]( Plugin* plugin ) {
795 if ( nullptr == mUISceneNode || plugin->isReady() ) {
796 onPluginEnabled( plugin );
797 } else {
798 // If plugin loads asynchronously and is not ready, delay the plugin enabled callback
799 plugin->addOnReadyCallback( [this]( UICodeEditorPlugin* plugin, const Uint32& cbId ) {
800 mUISceneNode->runOnMainThread(
801 [this, plugin]() { onPluginEnabled( static_cast<Plugin*>( plugin ) ); } );
802 plugin->removeReadyCallback( cbId );
803 } );
804 }
805 };
806
807 mPluginManager->registerPlugin( DebuggerPlugin::Definition() );
808 mPluginManager->registerPlugin( LinterPlugin::Definition() );
809 mPluginManager->registerPlugin( FormatterPlugin::Definition() );
810 mPluginManager->registerPlugin( AutoCompletePlugin::Definition() );
811 mPluginManager->registerPlugin( LSPClientPlugin::Definition() );
812 mPluginManager->registerPlugin( XMLToolsPlugin::Definition() );
813 mPluginManager->registerPlugin( GitPlugin::Definition() );
814 mPluginManager->registerPlugin( AIAssistantPlugin::Definition() );
815 mPluginManager->registerPlugin( SpellCheckerPlugin::Definition() );
816 mPluginManager->registerPlugin( DiscordRPCplugin::Definition() );
817 mPluginManager->setPluginsDisabled( mDisablePlugins );
818}
819
820std::pair<bool, std::string> App::generateConfigPath() {
821 if ( mPortableMode ) {

Callers

nothing calls this directly

Calls 10

isDocumentOpenMethod · 0.80
getOwnedWidgetMethod · 0.80
addOnReadyCallbackMethod · 0.80
runOnMainThreadMethod · 0.80
removeReadyCallbackMethod · 0.80
setPluginsDisabledMethod · 0.80
setTabSelectedMethod · 0.45
getTabWidgetMethod · 0.45
isReadyMethod · 0.45
registerPluginMethod · 0.45

Tested by

no test coverage detected