Do not reconstruct user config files if the configuration file is broken, just notify the user that it's broken. Worst case scenario will have to reset it, addresses SpartanJ/ecode#827.

This commit is contained in:
Martín Lucas Golini
2026-02-27 01:19:55 -03:00
parent 3b671bbb97
commit 8cd44ed8c5
11 changed files with 853 additions and 7 deletions

View File

@@ -51,11 +51,13 @@ class AIAssistantPlugin : public PluginBase {
protected:
LLMProviders mProviders;
bool mUIInit{ false };
bool mBrokenUserConfigFile{ false };
UIWidget* mStatusBar{ nullptr };
UIPushButton* mAIChatButton{ nullptr };
UnorderedMap<std::string, std::string> mApiKeys;
AIAssistantConfig mConfig;
Uint32 mAIChatButtonPosCbId{ 0 };
std::string mConfigFileError;
AIAssistantPlugin( PluginManager* pluginManager, bool sync );
@@ -72,6 +74,8 @@ class AIAssistantPlugin : public PluginBase {
void onRegisterDocument( TextDocument* doc ) override;
void initUI();
void displayBrokenUserConfigFileWarning();
};
} // namespace ecode