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

Method load

src/tools/ecode/plugins/debugger/debuggerplugin.cpp:368–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368void DebuggerPlugin::load( PluginManager* pluginManager ) {
369 Clock clock;
370 AtomicBoolScopedOp loading( mLoading, true );
371 pluginManager->subscribeMessages( this,
372 [this]( const auto& notification ) -> PluginRequestHandle {
373 return processMessage( notification );
374 } );
375 std::vector<std::string> paths;
376 std::string path( pluginManager->getResourcesPath() + "plugins/debugger.json" );
377 if ( FileSystem::fileExists( path ) )
378 paths.emplace_back( path );
379 path = pluginManager->getPluginsPath() + "debugger.json";
380 if ( FileSystem::fileExists( path ) ||
381 FileSystem::fileWrite(
382 path, "{\n \"config\":{},\n \"keybindings\":{},\n \"dap\":[]\n}\n" ) ) {
383 mConfigPath = path;
384 paths.emplace_back( path );
385 }
386 if ( paths.empty() )
387 return;
388
389 for ( const auto& ipath : paths ) {
390 try {
391 loadDAPConfig( ipath, mConfigPath == ipath );
392 } catch ( const json::exception& e ) {
393 Log::error( "Parsing Debugger \"%s\" failed:\n%s", ipath.c_str(), e.what() );
394 }
395 }
396
397 if ( getUISceneNode() )
398 updateUI();
399
400 subscribeFileSystemListener();
401 mReady = true;
402 fireReadyCbs();
403 setReady( clock.getElapsedTime() );
404}
405
406static std::initializer_list<std::string> DebuggerCommandList = {
407 "debugger-continue-interrupt",

Callers 2

makeRequestMethod · 0.45
makeResponseMethod · 0.45

Calls 5

errorFunction · 0.85
subscribeMessagesMethod · 0.80
c_strMethod · 0.80
getElapsedTimeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected