Skip to content

Commit

Permalink
More WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpartanJ committed Dec 28, 2024
1 parent 42e7369 commit d07bb25
Show file tree
Hide file tree
Showing 19 changed files with 534 additions and 135 deletions.
19 changes: 19 additions & 0 deletions projects/linux/ee.files
Original file line number Diff line number Diff line change
Expand Up @@ -1574,11 +1574,30 @@
../../src/tools/ecode/pathhelper.hpp
../../src/tools/ecode/plugins/autocomplete/autocompleteplugin.cpp
../../src/tools/ecode/plugins/autocomplete/autocompleteplugin.hpp
../../src/tools/ecode/plugins/debugger/bus.cpp
../../src/tools/ecode/plugins/debugger/bus.hpp
../../src/tools/ecode/plugins/debugger/busprocess.cpp
../../src/tools/ecode/plugins/debugger/busprocess.hpp
../../src/tools/ecode/plugins/debugger/bussocket.cpp
../../src/tools/ecode/plugins/debugger/bussocket.hpp
../../src/tools/ecode/plugins/debugger/config.cpp
../../src/tools/ecode/plugins/debugger/config.hpp
../../src/tools/ecode/plugins/debugger/debuggerclient.cpp
../../src/tools/ecode/plugins/debugger/debuggerclient.hpp
../../src/tools/ecode/plugins/debugger/debuggerclientlistener.hpp
../../src/tools/ecode/plugins/debugger/debuggerplugin.cpp
../../src/tools/ecode/plugins/debugger/debuggerplugin.hpp
../../src/tools/ecode/plugins/formatter/formatterplugin.cpp
../../src/tools/ecode/plugins/formatter/formatterplugin.hpp
../../src/tools/ecode/notificationcenter.cpp
../../src/tools/ecode/notificationcenter.hpp
../../src/tools/ecode/pathhelper.hpp
../../src/tools/ecode/plugins/debugger/dap/debuggerclientdap.cpp
../../src/tools/ecode/plugins/debugger/dap/debuggerclientdap.hpp
../../src/tools/ecode/plugins/debugger/dap/messages.hpp
../../src/tools/ecode/plugins/debugger/dap/protocol.cpp
../../src/tools/ecode/plugins/debugger/dap/protocol.hpp
../../src/tools/ecode/plugins/debugger/debuggerclientlistener.cpp
../../src/tools/ecode/plugins/git/git.cpp
../../src/tools/ecode/plugins/git/git.hpp
../../src/tools/ecode/plugins/git/gitbranchmodel.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/tools/ecode/appconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void AppConfig::load( const std::string& confPath, std::string& keybindingsPath,
ini.getValueB( "plugins", creator.first,
"autocomplete" == creator.first || "linter" == creator.first ||
"autoformatter" == creator.first || "lspclient" == creator.first ||
"git" == creator.first );
"git" == creator.first || "debugger" == creator.first );
}
pluginManager->setPluginsEnabled( pluginsEnabled, sync );

Expand Down
8 changes: 5 additions & 3 deletions src/tools/ecode/ecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

//! Plugins
#include "plugins/autocomplete/autocompleteplugin.hpp"
#include "plugins/formatter/formatterplugin.hpp"
#include "plugins/debugger/debuggerplugin.hpp"
#include "plugins/formatter/formatterplugin.hpp"
#include "plugins/git/gitplugin.hpp"
#include "plugins/linter/linterplugin.hpp"
#include "plugins/lsp/lspclientplugin.hpp"
Expand Down Expand Up @@ -554,15 +554,17 @@ void App::onPluginEnabled( Plugin* plugin ) {

void App::initPluginManager() {
mPluginManager = std::make_unique<PluginManager>(
mResPath, mPluginsPath, mThreadPool, [this]( const std::string& path, const auto& cb ) {
mResPath, mPluginsPath, mThreadPool,
[this]( const std::string& path, const auto& cb ) {
UITab* tab = mSplitter->isDocumentOpen( path );
if ( !tab ) {
loadFileFromPath( path, true, nullptr, cb );
} else {
tab->getTabWidget()->setTabSelected( tab );
cb( tab->getOwnedWidget()->asType<UICodeEditor>(), path );
}
} );
},
[this] { return getProjectBuildManager(); } );
mPluginManager->onPluginEnabled = [this]( Plugin* plugin ) {
if ( nullptr == mUISceneNode || plugin->isReady() ) {
onPluginEnabled( plugin );
Expand Down
3 changes: 3 additions & 0 deletions src/tools/ecode/iconmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ void IconManager::init( UISceneNode* sceneNode, FontTrueType* iconFont, FontTrue
{ "play", 0xeb2c },
{ "output", 0xeb9d },
{ "fold", 0xeaf5 },
{ "bug", 0xeaaf },
{ "debug", 0xead8 },
{ "debug-alt", 0xeb91 },
};

for ( const auto& icon : codIcons )
Expand Down
17 changes: 13 additions & 4 deletions src/tools/ecode/plugins/debugger/busprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ namespace ecode {

BusProcess::BusProcess( const Command& command ) : mCommand( command ), mProcess() {}

BusProcess::~BusProcess() {
close();
}

bool BusProcess::start() {
bool res = mProcess.create( mCommand.command, mCommand.arguments,
Process::getDefaultOptions() | Process::Options::EnableAsync |
Process::Options::CombinedStdoutStderr,
mCommand.environment );
bool res = mCommand.arguments.empty()
? mProcess.create( mCommand.command,
Process::getDefaultOptions() | Process::Options::EnableAsync |
Process::Options::CombinedStdoutStderr,
mCommand.environment )
: mProcess.create( mCommand.command, mCommand.arguments,
Process::getDefaultOptions() | Process::Options::EnableAsync |
Process::Options::CombinedStdoutStderr,
mCommand.environment );
if ( res )
setState( State::Running );

Expand Down
2 changes: 2 additions & 0 deletions src/tools/ecode/plugins/debugger/busprocess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class BusProcess : public Bus {
public:
BusProcess( const Command& command );

virtual ~BusProcess();

bool start() override;

bool close() override;
Expand Down
4 changes: 4 additions & 0 deletions src/tools/ecode/plugins/debugger/bussocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ namespace ecode {

BusSocket::BusSocket( const Connection& connection ) : mConnection( connection ) {}

BusSocket::~BusSocket() {
close();
}

bool BusSocket::start() {
bool res =
mSocket.connect( IpAddress( mConnection.host ), mConnection.port ) == Socket::Status::Done;
Expand Down
2 changes: 2 additions & 0 deletions src/tools/ecode/plugins/debugger/bussocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class BusSocket : public Bus {
public:
BusSocket( const Connection& connection );

virtual ~BusSocket();

bool start() override;

bool close() override;
Expand Down
1 change: 1 addition & 0 deletions src/tools/ecode/plugins/debugger/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct ProtocolSettings {
bool redirectStderr{ false };
bool redirectStdout{ false };
bool supportsSourceRequest{ true };
std::string launchCommand{ "launch" };
json launchRequest;
std::string locale{ "en-US" };

Expand Down
Loading

0 comments on commit d07bb25

Please sign in to comment.