diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-13 16:56:21 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-15 14:35:45 +0200 |
commit | 25b2f1780a9c7d7ae5579cc87c89b0c7e2baa14d (patch) | |
tree | 40d2d50d34c175da3b7c5123e8918cc5816bd32b /modules/gdscript | |
parent | 773414606079fa745d1c37fce49324ab6a09e972 (diff) | |
download | redot-engine-25b2f1780a9c7d7ae5579cc87c89b0c7e2baa14d.tar.gz |
Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:
Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.
Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:
- Local includes
* Conditional local includes
- Core includes
* Conditional core includes
- Thirdparty includes
* Conditional thirdparty includes
Diffstat (limited to 'modules/gdscript')
36 files changed, 132 insertions, 77 deletions
diff --git a/modules/gdscript/editor/gdscript_docgen.cpp b/modules/gdscript/editor/gdscript_docgen.cpp index ce64d79747..df17581ad1 100644 --- a/modules/gdscript/editor/gdscript_docgen.cpp +++ b/modules/gdscript/editor/gdscript_docgen.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "gdscript_docgen.h" + #include "../gdscript.h" using GDP = GDScriptParser; diff --git a/modules/gdscript/editor/gdscript_docgen.h b/modules/gdscript/editor/gdscript_docgen.h index bb3647196a..3357fb680c 100644 --- a/modules/gdscript/editor/gdscript_docgen.h +++ b/modules/gdscript/editor/gdscript_docgen.h @@ -32,6 +32,7 @@ #define GDSCRIPT_DOCGEN_H #include "../gdscript_parser.h" + #include "core/doc_data.h" class GDScriptDocGen { diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index bba11363d5..b54dc502ae 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -29,8 +29,10 @@ /**************************************************************************/ #include "gdscript_highlighter.h" + #include "../gdscript.h" #include "../gdscript_tokenizer.h" + #include "core/config/project_settings.h" #include "editor/editor_settings.h" diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp index 3458eb43b5..e17e748d7b 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp @@ -30,8 +30,9 @@ #include "gdscript_translation_parser_plugin.h" +#include "../gdscript.h" + #include "core/io/resource_loader.h" -#include "modules/gdscript/gdscript.h" void GDScriptEditorTranslationParserPlugin::get_recognized_extensions(List<String> *r_extensions) const { GDScriptLanguage::get_singleton()->get_recognized_extensions(r_extensions); diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.h b/modules/gdscript/editor/gdscript_translation_parser_plugin.h index 7e6e381e3f..421030e49a 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.h +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.h @@ -31,9 +31,10 @@ #ifndef GDSCRIPT_TRANSLATION_PARSER_PLUGIN_H #define GDSCRIPT_TRANSLATION_PARSER_PLUGIN_H +#include "../gdscript_parser.h" + #include "core/templates/hash_set.h" #include "editor/editor_translation_parser.h" -#include "modules/gdscript/gdscript_parser.h" class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlugin { GDCLASS(GDScriptEditorTranslationParserPlugin, EditorTranslationParserPlugin); diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 945dfc9862..c3547e3db7 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -30,15 +30,6 @@ #include "gdscript.h" -#include <stdint.h> - -#include "core/config/engine.h" -#include "core/config/project_settings.h" -#include "core/core_constants.h" -#include "core/core_string_names.h" -#include "core/io/file_access.h" -#include "core/io/file_access_encrypted.h" -#include "core/os/os.h" #include "gdscript_analyzer.h" #include "gdscript_cache.h" #include "gdscript_compiler.h" @@ -46,15 +37,28 @@ #include "gdscript_rpc_callable.h" #include "gdscript_warning.h" +#ifdef TOOLS_ENABLED +#include "editor/gdscript_docgen.h" +#endif + #ifdef TESTS_ENABLED #include "tests/gdscript_test_runner.h" #endif +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/core_constants.h" +#include "core/core_string_names.h" +#include "core/io/file_access.h" +#include "core/io/file_access_encrypted.h" +#include "core/os/os.h" + #ifdef TOOLS_ENABLED #include "editor/editor_paths.h" -#include "editor/gdscript_docgen.h" #endif +#include <stdint.h> + /////////////////////////// GDScriptNativeClass::GDScriptNativeClass(const StringName &p_name) { diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 60bd9eef53..1d6ff6406a 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -31,6 +31,8 @@ #ifndef GDSCRIPT_H #define GDSCRIPT_H +#include "gdscript_function.h" + #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" #include "core/doc_data.h" @@ -38,7 +40,6 @@ #include "core/io/resource_saver.h" #include "core/object/script_language.h" #include "core/templates/rb_set.h" -#include "gdscript_function.h" class GDScriptNativeClass : public RefCounted { GDCLASS(GDScriptNativeClass, RefCounted); diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 8251de2956..2c96aac99d 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -30,6 +30,9 @@ #include "gdscript_analyzer.h" +#include "gdscript.h" +#include "gdscript_utility_functions.h" + #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/core_constants.h" @@ -39,8 +42,6 @@ #include "core/object/class_db.h" #include "core/object/script_language.h" #include "core/templates/hash_map.h" -#include "gdscript.h" -#include "gdscript_utility_functions.h" #include "scene/resources/packed_scene.h" #if defined(TOOLS_ENABLED) && !defined(DISABLE_DEPRECATED) diff --git a/modules/gdscript/gdscript_analyzer.h b/modules/gdscript/gdscript_analyzer.h index 0c7bf4125b..6a80fc272d 100644 --- a/modules/gdscript/gdscript_analyzer.h +++ b/modules/gdscript/gdscript_analyzer.h @@ -31,11 +31,12 @@ #ifndef GDSCRIPT_ANALYZER_H #define GDSCRIPT_ANALYZER_H +#include "gdscript_cache.h" +#include "gdscript_parser.h" + #include "core/object/object.h" #include "core/object/ref_counted.h" #include "core/templates/hash_set.h" -#include "gdscript_cache.h" -#include "gdscript_parser.h" class GDScriptAnalyzer { GDScriptParser *parser = nullptr; diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp index 1414075ba8..3239f64cb2 100644 --- a/modules/gdscript/gdscript_byte_codegen.cpp +++ b/modules/gdscript/gdscript_byte_codegen.cpp @@ -30,9 +30,10 @@ #include "gdscript_byte_codegen.h" -#include "core/debugger/engine_debugger.h" #include "gdscript.h" +#include "core/debugger/engine_debugger.h" + uint32_t GDScriptByteCodeGenerator::add_parameter(const StringName &p_name, bool p_is_optional, const GDScriptDataType &p_type) { #ifdef TOOLS_ENABLED function->arg_names.push_back(p_name); diff --git a/modules/gdscript/gdscript_byte_codegen.h b/modules/gdscript/gdscript_byte_codegen.h index fc684e4d8f..bed5cc2405 100644 --- a/modules/gdscript/gdscript_byte_codegen.h +++ b/modules/gdscript/gdscript_byte_codegen.h @@ -32,7 +32,6 @@ #define GDSCRIPT_BYTE_CODEGEN_H #include "gdscript_codegen.h" - #include "gdscript_function.h" #include "gdscript_utility_functions.h" diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 126fccbbf0..79f26e529c 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -30,12 +30,13 @@ #include "gdscript_cache.h" -#include "core/io/file_access.h" -#include "core/templates/vector.h" #include "gdscript.h" #include "gdscript_analyzer.h" #include "gdscript_compiler.h" #include "gdscript_parser.h" + +#include "core/io/file_access.h" +#include "core/templates/vector.h" #include "scene/resources/packed_scene.h" bool GDScriptParserRef::is_valid() const { diff --git a/modules/gdscript/gdscript_cache.h b/modules/gdscript/gdscript_cache.h index 28266a1c0b..0a0f403e44 100644 --- a/modules/gdscript/gdscript_cache.h +++ b/modules/gdscript/gdscript_cache.h @@ -31,11 +31,12 @@ #ifndef GDSCRIPT_CACHE_H #define GDSCRIPT_CACHE_H +#include "gdscript.h" + #include "core/object/ref_counted.h" #include "core/os/mutex.h" #include "core/templates/hash_map.h" #include "core/templates/hash_set.h" -#include "gdscript.h" #include "scene/resources/packed_scene.h" class GDScriptAnalyzer; diff --git a/modules/gdscript/gdscript_codegen.h b/modules/gdscript/gdscript_codegen.h index dbc2466393..fa1732d58f 100644 --- a/modules/gdscript/gdscript_codegen.h +++ b/modules/gdscript/gdscript_codegen.h @@ -31,11 +31,12 @@ #ifndef GDSCRIPT_CODEGEN_H #define GDSCRIPT_CODEGEN_H -#include "core/string/string_name.h" -#include "core/variant/variant.h" #include "gdscript_function.h" #include "gdscript_utility_functions.h" +#include "core/string/string_name.h" +#include "core/variant/variant.h" + class GDScriptCodeGenerator { public: struct Address { diff --git a/modules/gdscript/gdscript_compiler.h b/modules/gdscript/gdscript_compiler.h index 2d15d461fb..494eef41d9 100644 --- a/modules/gdscript/gdscript_compiler.h +++ b/modules/gdscript/gdscript_compiler.h @@ -31,12 +31,13 @@ #ifndef GDSCRIPT_COMPILER_H #define GDSCRIPT_COMPILER_H -#include "core/templates/hash_set.h" #include "gdscript.h" #include "gdscript_codegen.h" #include "gdscript_function.h" #include "gdscript_parser.h" +#include "core/templates/hash_set.h" + class GDScriptCompiler { const GDScriptParser *parser = nullptr; HashSet<GDScript *> parsed_classes; diff --git a/modules/gdscript/gdscript_disassembler.cpp b/modules/gdscript/gdscript_disassembler.cpp index 45ad8792d9..cf33f12e3a 100644 --- a/modules/gdscript/gdscript_disassembler.cpp +++ b/modules/gdscript/gdscript_disassembler.cpp @@ -30,10 +30,10 @@ #ifdef DEBUG_ENABLED +#include "gdscript.h" #include "gdscript_function.h" #include "core/string/string_builder.h" -#include "gdscript.h" static String _get_variant_string(const Variant &p_variant) { String txt; @@ -1130,4 +1130,4 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const { } } -#endif +#endif // DEBUG_ENABLED diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 09af51656c..07122ed594 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -30,9 +30,6 @@ #include "gdscript.h" -#include "core/config/engine.h" -#include "core/core_constants.h" -#include "core/io/file_access.h" #include "gdscript_analyzer.h" #include "gdscript_compiler.h" #include "gdscript_parser.h" @@ -40,10 +37,17 @@ #include "gdscript_utility_functions.h" #ifdef TOOLS_ENABLED +#include "editor/script_templates/templates.gen.h" +#endif + +#include "core/config/engine.h" +#include "core/core_constants.h" +#include "core/io/file_access.h" + +#ifdef TOOLS_ENABLED #include "core/config/project_settings.h" #include "editor/editor_file_system.h" #include "editor/editor_settings.h" -#include "editor/script_templates/templates.gen.h" #endif void GDScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const { diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index 390e562e6f..b6f3e7cc87 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -31,6 +31,8 @@ #ifndef GDSCRIPT_FUNCTION_H #define GDSCRIPT_FUNCTION_H +#include "gdscript_utility_functions.h" + #include "core/object/ref_counted.h" #include "core/object/script_language.h" #include "core/os/thread.h" @@ -38,7 +40,6 @@ #include "core/templates/pair.h" #include "core/templates/self_list.h" #include "core/variant/variant.h" -#include "gdscript_utility_functions.h" class GDScriptInstance; class GDScript; diff --git a/modules/gdscript/gdscript_lambda_callable.cpp b/modules/gdscript/gdscript_lambda_callable.cpp index e9fe17bb17..9e14e43a58 100644 --- a/modules/gdscript/gdscript_lambda_callable.cpp +++ b/modules/gdscript/gdscript_lambda_callable.cpp @@ -30,9 +30,10 @@ #include "gdscript_lambda_callable.h" -#include "core/templates/hashfuncs.h" #include "gdscript.h" +#include "core/templates/hashfuncs.h" + bool GDScriptLambdaCallable::compare_equal(const CallableCustom *p_a, const CallableCustom *p_b) { // Lambda callables are only compared by reference. return p_a == p_b; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index d90503c658..de8a5c66f4 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -30,23 +30,27 @@ #include "gdscript_parser.h" +#include "gdscript.h" + +#ifdef DEBUG_ENABLED +#include "gdscript_warning.h" +#endif + #include "core/config/project_settings.h" #include "core/io/file_access.h" #include "core/io/resource_loader.h" #include "core/math/math_defs.h" -#include "gdscript.h" #include "scene/main/multiplayer_api.h" #ifdef DEBUG_ENABLED #include "core/os/os.h" #include "core/string/string_builder.h" -#include "gdscript_warning.h" #include "servers/text_server.h" -#endif // DEBUG_ENABLED +#endif #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" -#endif // TOOLS_ENABLED +#endif static HashMap<StringName, Variant::Type> builtin_types; Variant::Type GDScriptParser::get_builtin_type(const StringName &p_type) { diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 8f0265510f..ad08c3bfd6 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -31,6 +31,13 @@ #ifndef GDSCRIPT_PARSER_H #define GDSCRIPT_PARSER_H +#include "gdscript_cache.h" +#include "gdscript_tokenizer.h" + +#ifdef DEBUG_ENABLED +#include "gdscript_warning.h" +#endif + #include "core/io/resource.h" #include "core/object/ref_counted.h" #include "core/object/script_language.h" @@ -41,13 +48,10 @@ #include "core/templates/rb_map.h" #include "core/templates/vector.h" #include "core/variant/variant.h" -#include "gdscript_cache.h" -#include "gdscript_tokenizer.h" #ifdef DEBUG_ENABLED #include "core/string/string_builder.h" -#include "gdscript_warning.h" -#endif // DEBUG_ENABLED +#endif class GDScriptParser { struct AnnotationInfo; diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index a45a73a8d5..c77783e5a3 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -33,13 +33,14 @@ #include "core/error/error_macros.h" #include "core/string/char_utils.h" -#ifdef TOOLS_ENABLED -#include "editor/editor_settings.h" -#endif #ifdef DEBUG_ENABLED #include "servers/text_server.h" #endif +#ifdef TOOLS_ENABLED +#include "editor/editor_settings.h" +#endif + static const char *token_names[] = { "Empty", // EMPTY, // Basic diff --git a/modules/gdscript/gdscript_utility_functions.cpp b/modules/gdscript/gdscript_utility_functions.cpp index 8862450121..030950267d 100644 --- a/modules/gdscript/gdscript_utility_functions.cpp +++ b/modules/gdscript/gdscript_utility_functions.cpp @@ -30,6 +30,8 @@ #include "gdscript_utility_functions.h" +#include "gdscript.h" + #include "core/io/resource_loader.h" #include "core/object/class_db.h" #include "core/object/method_bind.h" @@ -37,7 +39,6 @@ #include "core/templates/oa_hash_map.h" #include "core/templates/vector.h" #include "core/variant/typed_array.h" -#include "gdscript.h" #ifdef DEBUG_ENABLED diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index bebf34cbb3..0ffc025c24 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -28,12 +28,12 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "gdscript.h" #include "gdscript_function.h" +#include "gdscript_lambda_callable.h" #include "core/core_string_names.h" #include "core/os/os.h" -#include "gdscript.h" -#include "gdscript_lambda_callable.h" #ifdef DEBUG_ENABLED static String _get_script_name(const Ref<Script> p_script) { diff --git a/modules/gdscript/language_server/gdscript_extend_parser.h b/modules/gdscript/language_server/gdscript_extend_parser.h index 4500cb01f3..4fd27de081 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.h +++ b/modules/gdscript/language_server/gdscript_extend_parser.h @@ -32,9 +32,10 @@ #define GDSCRIPT_EXTEND_PARSER_H #include "../gdscript_parser.h" -#include "core/variant/variant.h" #include "godot_lsp.h" +#include "core/variant/variant.h" + #ifndef LINE_NUMBER_TO_INDEX #define LINE_NUMBER_TO_INDEX(p_line) ((p_line)-1) #endif diff --git a/modules/gdscript/language_server/gdscript_language_protocol.h b/modules/gdscript/language_server/gdscript_language_protocol.h index d25814f8aa..a4d9dc6b1d 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.h +++ b/modules/gdscript/language_server/gdscript_language_protocol.h @@ -31,13 +31,14 @@ #ifndef GDSCRIPT_LANGUAGE_PROTOCOL_H #define GDSCRIPT_LANGUAGE_PROTOCOL_H -#include "core/io/stream_peer.h" -#include "core/io/stream_peer_tcp.h" -#include "core/io/tcp_server.h" #include "gdscript_text_document.h" #include "gdscript_workspace.h" #include "godot_lsp.h" +#include "core/io/stream_peer.h" +#include "core/io/stream_peer_tcp.h" +#include "core/io/tcp_server.h" + #include "modules/modules_enabled.gen.h" // For jsonrpc. #ifdef MODULE_JSONRPC_ENABLED #include "modules/jsonrpc/jsonrpc.h" diff --git a/modules/gdscript/language_server/gdscript_language_server.h b/modules/gdscript/language_server/gdscript_language_server.h index a130dc3ac8..75f9403a74 100644 --- a/modules/gdscript/language_server/gdscript_language_server.h +++ b/modules/gdscript/language_server/gdscript_language_server.h @@ -32,9 +32,10 @@ #define GDSCRIPT_LANGUAGE_SERVER_H #include "../gdscript_parser.h" -#include "editor/editor_plugin.h" #include "gdscript_language_protocol.h" +#include "editor/editor_plugin.h" + class GDScriptLanguageServer : public EditorPlugin { GDCLASS(GDScriptLanguageServer, EditorPlugin); diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index 35fbdca949..92a5f55978 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -31,11 +31,12 @@ #include "gdscript_text_document.h" #include "../gdscript.h" +#include "gdscript_extend_parser.h" +#include "gdscript_language_protocol.h" + #include "core/os/os.h" #include "editor/editor_settings.h" #include "editor/plugins/script_text_editor.h" -#include "gdscript_extend_parser.h" -#include "gdscript_language_protocol.h" #include "servers/display_server.h" void GDScriptTextDocument::_bind_methods() { diff --git a/modules/gdscript/language_server/gdscript_text_document.h b/modules/gdscript/language_server/gdscript_text_document.h index aeda10de89..0121101db2 100644 --- a/modules/gdscript/language_server/gdscript_text_document.h +++ b/modules/gdscript/language_server/gdscript_text_document.h @@ -31,9 +31,10 @@ #ifndef GDSCRIPT_TEXT_DOCUMENT_H #define GDSCRIPT_TEXT_DOCUMENT_H +#include "godot_lsp.h" + #include "core/io/file_access.h" #include "core/object/ref_counted.h" -#include "godot_lsp.h" class GDScriptTextDocument : public RefCounted { GDCLASS(GDScriptTextDocument, RefCounted) diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index 7fc2962341..9f848b02f5 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -32,6 +32,8 @@ #include "../gdscript.h" #include "../gdscript_parser.h" +#include "gdscript_language_protocol.h" + #include "core/config/project_settings.h" #include "core/object/script_language.h" #include "editor/doc_tools.h" @@ -39,7 +41,6 @@ #include "editor/editor_help.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" -#include "gdscript_language_protocol.h" #include "scene/resources/packed_scene.h" void GDScriptWorkspace::_bind_methods() { diff --git a/modules/gdscript/language_server/gdscript_workspace.h b/modules/gdscript/language_server/gdscript_workspace.h index a849ef8a8d..80653778fb 100644 --- a/modules/gdscript/language_server/gdscript_workspace.h +++ b/modules/gdscript/language_server/gdscript_workspace.h @@ -32,11 +32,12 @@ #define GDSCRIPT_WORKSPACE_H #include "../gdscript_parser.h" -#include "core/variant/variant.h" -#include "editor/editor_file_system.h" #include "gdscript_extend_parser.h" #include "godot_lsp.h" +#include "core/variant/variant.h" +#include "editor/editor_file_system.h" + class GDScriptWorkspace : public RefCounted { GDCLASS(GDScriptWorkspace, RefCounted); diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index b6feaadccf..e23bd50b8b 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -30,39 +30,51 @@ #include "register_types.h" -#include "core/io/dir_access.h" -#include "core/io/file_access.h" -#include "core/io/file_access_encrypted.h" -#include "core/io/resource_loader.h" #include "gdscript.h" #include "gdscript_analyzer.h" #include "gdscript_cache.h" #include "gdscript_tokenizer.h" #include "gdscript_utility_functions.h" +#ifdef TOOLS_ENABLED +#include "editor/gdscript_highlighter.h" +#include "editor/gdscript_translation_parser_plugin.h" + +#ifndef GDSCRIPT_NO_LSP +#include "language_server/gdscript_language_server.h" +#endif +#endif // TOOLS_ENABLED + #ifdef TESTS_ENABLED #include "tests/test_gdscript.h" -#include "tests/test_macros.h" #endif -GDScriptLanguage *script_language_gd = nullptr; -Ref<ResourceFormatLoaderGDScript> resource_loader_gd; -Ref<ResourceFormatSaverGDScript> resource_saver_gd; -GDScriptCache *gdscript_cache = nullptr; +#include "core/io/dir_access.h" +#include "core/io/file_access.h" +#include "core/io/file_access_encrypted.h" +#include "core/io/resource_loader.h" #ifdef TOOLS_ENABLED - #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "editor/editor_translation_parser.h" #include "editor/export/editor_export.h" -#include "editor/gdscript_highlighter.h" -#include "editor/gdscript_translation_parser_plugin.h" #ifndef GDSCRIPT_NO_LSP #include "core/config/engine.h" -#include "language_server/gdscript_language_server.h" -#endif // !GDSCRIPT_NO_LSP +#endif +#endif // TOOLS_ENABLED + +#ifdef TESTS_ENABLED +#include "tests/test_macros.h" +#endif + +GDScriptLanguage *script_language_gd = nullptr; +Ref<ResourceFormatLoaderGDScript> resource_loader_gd; +Ref<ResourceFormatSaverGDScript> resource_saver_gd; +GDScriptCache *gdscript_cache = nullptr; + +#ifdef TOOLS_ENABLED Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin; diff --git a/modules/gdscript/tests/gdscript_test_runner.h b/modules/gdscript/tests/gdscript_test_runner.h index 60b48c6a57..b1190604ad 100644 --- a/modules/gdscript/tests/gdscript_test_runner.h +++ b/modules/gdscript/tests/gdscript_test_runner.h @@ -32,6 +32,7 @@ #define GDSCRIPT_TEST_RUNNER_H #include "../gdscript.h" + #include "core/error/error_macros.h" #include "core/string/print_string.h" #include "core/string/ustring.h" diff --git a/modules/gdscript/tests/gdscript_test_runner_suite.h b/modules/gdscript/tests/gdscript_test_runner_suite.h index e27b6218f1..5fd7d942d2 100644 --- a/modules/gdscript/tests/gdscript_test_runner_suite.h +++ b/modules/gdscript/tests/gdscript_test_runner_suite.h @@ -32,6 +32,7 @@ #define GDSCRIPT_TEST_RUNNER_SUITE_H #include "gdscript_test_runner.h" + #include "tests/test_macros.h" namespace GDScriptTests { diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index ad38312abe..0446a7aad6 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -30,6 +30,11 @@ #include "test_gdscript.h" +#include "../gdscript_analyzer.h" +#include "../gdscript_compiler.h" +#include "../gdscript_parser.h" +#include "../gdscript_tokenizer.h" + #include "core/config/project_settings.h" #include "core/io/file_access.h" #include "core/io/file_access_pack.h" @@ -38,11 +43,6 @@ #include "core/string/string_builder.h" #include "scene/resources/packed_scene.h" -#include "modules/gdscript/gdscript_analyzer.h" -#include "modules/gdscript/gdscript_compiler.h" -#include "modules/gdscript/gdscript_parser.h" -#include "modules/gdscript/gdscript_tokenizer.h" - #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" #endif diff --git a/modules/gdscript/tests/test_gdscript.h b/modules/gdscript/tests/test_gdscript.h index d719e3d94a..b39dfe2b5a 100644 --- a/modules/gdscript/tests/test_gdscript.h +++ b/modules/gdscript/tests/test_gdscript.h @@ -32,6 +32,7 @@ #define TEST_GDSCRIPT_H #include "gdscript_test_runner.h" + #include "tests/test_macros.h" namespace GDScriptTests { |