Remove unused includes in servers with clangd-tidy#117295
Conversation
| @@ -35,7 +35,7 @@ | |||
| #include "core/config/project_settings.h" | |||
| #include "core/object/callable_mp.h" | |||
| #include "core/object/class_db.h" | |||
| #include "scene/main/node.h" | |||
| #include "scene/main/node.h" // IWYU pragma: keep. Needed to bind `Node *` arg. | |||
There was a problem hiding this comment.
For the record, the error when removing this:
https://pastebin.com/0PmHNDiA
| #include "scene/resources/2d/navigation_mesh_source_geometry_data_2d.h" | ||
| #include "scene/resources/2d/navigation_polygon.h" | ||
| #include "servers/navigation_2d/navigation_path_query_parameters_2d.h" | ||
| #include "servers/navigation_2d/navigation_path_query_result_2d.h" | ||
|
|
||
| class Node; |
There was a problem hiding this comment.
Just added for clarity, it's already forward-declared through other includes but since it's used explicitly, it's a prime candidate for a compile error in the future as we clean stuff up.
| #include "core/math/aabb.h" | ||
| #include "core/math/transform_3d.h" | ||
| #include "core/math/vector3i.h" | ||
| #include "core/templates/rid.h" |
There was a problem hiding this comment.
So these being missing didn't cause compiler errors for some reason, but clangd flags that it's a problem for them to be forward-declared here.
They're used explicitly as return values of methods declared here (e.g. virtual RID voxel_gi_allocate() override { return RID(); }) so it seems logical for the full type to be required.
I guess it's not a compile error currently because we just happen to include this file only in servers/rendering/dummy/rasterizer_dummy.cpp which itself probably has these types fully defined.
5dbcd0b to
f1d6327
Compare
|
Thanks! |
scenewith clangd-tidy #117286.