diff --git a/loader/include/Geode/modify/Modify.hpp b/loader/include/Geode/modify/Modify.hpp index e5cd1dd1..f0affb59 100644 --- a/loader/include/Geode/modify/Modify.hpp +++ b/loader/include/Geode/modify/Modify.hpp @@ -123,6 +123,12 @@ namespace geode::modifier { namespace geode { +// The intellisense compiler is quite dumb, and will very often error on modify classes +// with an error of "incomplete type is not allowed", despite not being an issue in actual compilation. +// So as a workaround use the compiler defined "__INTELLISENSE__" macro, which gets set to 1 on the intellisense pass. +// See https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170#microsoft-specific-predefined-macros +#if __INTELLISENSE__ != 1 + template class Modify : public Base { private: @@ -150,6 +156,16 @@ namespace geode { static void onModify(auto& self) {} }; + +#else + + template + class Modify : public Base { + public: + modifier::FieldIntermediate m_fields; + }; + +#endif } /** @@ -170,6 +186,8 @@ namespace geode { * I am bad at this stuff */ +#if __INTELLISENSE__ != 1 + #define GEODE_MODIFY_DECLARE_ANONYMOUS(base, derived) \ derived##Dummy; \ template \ @@ -184,6 +202,18 @@ namespace geode { derived##Dummy; \ struct GEODE_HIDDEN derived : geode::Modify +#else + +// Simplify the modify macro for intellisense, to hopefully help perfomance a bit + +#define GEODE_MODIFY_DECLARE(base, derived) \ + derived##Dummy; \ + struct derived : geode::Modify + +#define GEODE_MODIFY_DECLARE_ANONYMOUS(base, derived) GEODE_MODIFY_DECLARE(base, derived) + +#endif + #define GEODE_MODIFY_REDIRECT4(base, derived) GEODE_MODIFY_DECLARE(base, derived) #define GEODE_MODIFY_REDIRECT3(base, derived) GEODE_MODIFY_DECLARE_ANONYMOUS(base, derived) #define GEODE_MODIFY_REDIRECT2(base) GEODE_MODIFY_REDIRECT3(base, GEODE_CONCAT(hook, __LINE__))