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
This commit is contained in:
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user