ecode: Fix for textDocument/rename not loading un-opened files correctly (they were opening without plugins). Fixed Open Documents listing in Universal Locator.

This commit is contained in:
Martín Lucas Golini
2023-06-22 01:50:48 -03:00
parent 4120a25a24
commit 5ab1fa72d3
5 changed files with 62 additions and 26 deletions

View File

@@ -10,8 +10,11 @@ using json = nlohmann::json;
namespace ecode {
PluginManager::PluginManager( const std::string& resourcesPath, const std::string& pluginsPath,
std::shared_ptr<ThreadPool> pool ) :
mResourcesPath( resourcesPath ), mPluginsPath( pluginsPath ), mThreadPool( pool ) {}
std::shared_ptr<ThreadPool> pool, const OnLoadFileCb& loadFileCb ) :
mResourcesPath( resourcesPath ),
mPluginsPath( pluginsPath ),
mThreadPool( pool ),
mLoadFileFn( loadFileCb ) {}
PluginManager::~PluginManager() {
mClosing = true;
@@ -220,6 +223,10 @@ void PluginManager::unsubscribeMessages( const std::string& uniqueComponentId )
}
}
const PluginManager::OnLoadFileCb& PluginManager::getLoadFileFn() const {
return mLoadFileFn;
}
void PluginManager::subscribeMessages(
UICodeEditorPlugin* plugin, std::function<PluginRequestHandle( const PluginMessage& )> cb ) {
subscribeMessages( plugin->getId(), cb );