diff --git a/include/eepp/scene/node.hpp b/include/eepp/scene/node.hpp index d9cc7cf25..d035877fd 100644 --- a/include/eepp/scene/node.hpp +++ b/include/eepp/scene/node.hpp @@ -334,11 +334,11 @@ class EE_API Node : public Transformable { bool removeActions( const std::vector& actions ); - bool removeActionsByTag( const String::HashType& tag ); + bool removeActionsByTag( const Action::UniqueID& tag ); std::vector getActions(); - std::vector getActionsByTag( const Uint32& tag ); + std::vector getActionsByTag( const Action::UniqueID& tag ); void clearActions(); diff --git a/src/eepp/scene/node.cpp b/src/eepp/scene/node.cpp index 76413af94..cbda44610 100644 --- a/src/eepp/scene/node.cpp +++ b/src/eepp/scene/node.cpp @@ -1567,7 +1567,7 @@ bool Node::removeActions( const std::vector& actions ) { return getActionManager()->removeActions( actions ); } -bool Node::removeActionsByTag( const String::HashType& tag ) { +bool Node::removeActionsByTag( const Action::UniqueID& tag ) { return getActionManager()->removeActionsByTagFromTarget( this, tag ); } @@ -1575,7 +1575,7 @@ std::vector Node::getActions() { return getActionManager()->getActionsFromTarget( this ); } -std::vector Node::getActionsByTag( const Uint32& tag ) { +std::vector Node::getActionsByTag( const Action::UniqueID& tag ) { return getActionManager()->getActionsByTagFromTarget( this, tag ); } diff --git a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp index e5cc25038..5fd8a4139 100644 --- a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp @@ -1737,9 +1737,8 @@ bool LSPClientPlugin::onCreateContextMenu( UICodeEditor* editor, UIPopUpMenu* me addFn( "lsp-switch-header-source", i18n( "lsp_switch_header_source", "Switch Header/Source" ), "filetype-hpp" ); - String restartStr( i18n( "lsp_restart_lsp_server", "Restart LSP Server" ) + " (" + - server->getDefinition().name + ")" ); - addFn( "lsp-plugin-restart", restartStr, "refresh" ); + addFn( "lsp-plugin-restart", i18n( "lsp_restart_lsp_server", "Restart LSP Server" ), + "refresh" ); #ifdef EE_DEBUG if ( server->getDefinition().name == "clangd" ) diff --git a/src/tools/ecode/plugins/lsp/lspclientserver.cpp b/src/tools/ecode/plugins/lsp/lspclientserver.cpp index a52732851..e16a74dac 100644 --- a/src/tools/ecode/plugins/lsp/lspclientserver.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientserver.cpp @@ -1245,6 +1245,10 @@ LSPClientServer::~LSPClientServer() { shutdown(); std::unique_lock lock( mShutdownMutex ); mShutdownCond.wait_for( lock, std::chrono::milliseconds( 275 ), [this]() { return !mReady; } ); + + if ( mUsingProcess ) + mProcess.kill(); + eeSAFE_DELETE( mSocket ); { Lock l( mClientsMutex ); diff --git a/src/tools/ecode/plugins/lsp/lspclientservermanager.cpp b/src/tools/ecode/plugins/lsp/lspclientservermanager.cpp index 7aa123e6c..1708512f7 100644 --- a/src/tools/ecode/plugins/lsp/lspclientservermanager.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientservermanager.cpp @@ -230,6 +230,7 @@ void LSPClientServerManager::renameSymbol( const URI& uri, const TextPosition& p } bool LSPClientServerManager::isServerRunning( const LSPClientServer* server ) { + Lock l( mClientsMutex ); for ( const auto& svr : mClients ) { if ( server == svr.second.get() ) { if ( mErasingClients.find( svr.first ) != mErasingClients.end() ) @@ -285,6 +286,7 @@ void LSPClientServerManager::run( const std::shared_ptr& doc ) { } size_t LSPClientServerManager::clientCount() const { + Lock l( mClientsMutex ); return mClients.size(); } @@ -320,6 +322,7 @@ void LSPClientServerManager::updateDirty() { // Kill server only after N seconds of inactivity if ( server.second->getElapsedTime() > mLSPDecayTime ) { // If a document was opened while waiting, remove the server from the queue + Lock l( mClientsMutex ); auto clientServer = mClients.find( server.first ); if ( clientServer != mClients.end() && clientServer->second->hasDocuments() ) { invalidatedClose.push_back( server.first ); diff --git a/src/tools/ecode/plugins/lsp/lspclientservermanager.hpp b/src/tools/ecode/plugins/lsp/lspclientservermanager.hpp index 321847fa5..16f8f1e24 100644 --- a/src/tools/ecode/plugins/lsp/lspclientservermanager.hpp +++ b/src/tools/ecode/plugins/lsp/lspclientservermanager.hpp @@ -111,7 +111,7 @@ class LSPClientServerManager { std::map> mLSPsToClose; LSPWorkspaceFolder mLSPWorkspaceFolder; Clock mUpdateClock; - Mutex mClientsMutex; + mutable Mutex mClientsMutex; Time mLSPDecayTime{ Minutes( 1 ) }; std::vector supportsLSP( const std::shared_ptr& doc );