Create EditorHelpHighlighter in Project Manager

so that it works in Editor Settings opened without loading a project.
This commit is contained in:
cdemirer 2026-02-07 21:50:09 +03:00
parent 56f3e2611d
commit 86d336e1e0

View file

@ -39,6 +39,7 @@
#include "core/os/os.h"
#include "core/version.h"
#include "editor/asset_library/asset_library_editor_plugin.h"
#include "editor/doc/editor_help.h"
#include "editor/editor_string_names.h"
#include "editor/gui/editor_about.h"
#include "editor/gui/editor_file_dialog.h"
@ -76,6 +77,8 @@
#include "servers/physics_3d/physics_server_3d.h"
#endif // PHYSICS_3D_DISABLED
#include "modules/modules_enabled.gen.h" // For gdscript, mono. (For editor help highlighter).
constexpr int GODOT4_CONFIG_VERSION = 5;
ProjectManager *ProjectManager::singleton = nullptr;
@ -1384,6 +1387,10 @@ ProjectManager::ProjectManager() {
OS::get_singleton()->set_low_processor_usage_mode(true);
}
#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)
EditorHelpHighlighter::create_singleton();
#endif
SceneTree::get_singleton()->get_root()->connect("files_dropped", callable_mp(this, &ProjectManager::_files_dropped));
// Initialize UI.
@ -1971,6 +1978,11 @@ ProjectManager::ProjectManager() {
ProjectManager::~ProjectManager() {
singleton = nullptr;
EditorInspector::cleanup_plugins();
#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)
EditorHelpHighlighter::free_singleton();
#endif
if (EditorSettings::get_singleton()) {
EditorSettings::destroy();
}