Compare commits

...

3 Commits

Author SHA1 Message Date
15beb42d5f IWYU cleanup done 2026-04-08 03:26:22 -04:00
39cc7cd14b Next batch of IWYU cleanup 2026-04-08 03:14:08 -04:00
ba425c1ab3 First batch of include cleanups 2026-04-08 02:17:56 -04:00
25 changed files with 84 additions and 83 deletions

50
Docs/TASKS/IWYU.md Normal file
View File

@@ -0,0 +1,50 @@
Your job is to remove unnecessary include-files from a
single C++ source file in UE Wingman, and also, add missing
includes.
Remember: not all removals that compile are good according
to the principles of IWYU. A source file should include or
forward-define everything it uses, and should include
nothing that it doesn't. You will need to think seriously.
To test your work, you will need to do a build:
python3 build.py c++
followed by:
tools/clangd-query.py diagnostics <file>
Sometimes, clangd gets desynchronized. If clangd is
reporting an error on UCLASS or on GENERATED_BODY after a
successful build, then clangd is out of sync. In that case,
you will need to refresh clangd:
tools/clangd-query.py stop
Then you can try again with the diagnostics. If the testing
reveals a mistake, please fix it and then redo the testing.
Start by reading the head of TODO.txt, which lists the files
that need to be cleaned. Please clean up the first file on
the todo list, then remove that one file from the todo list.
Then you are done.
One special exception to IWYU: all unreal code should include
CoreMinimal.h, no matter what.
There is no need to run clangd before you begin. These
files are already clangd-clean.
Do not be chatty about it. Just begin, get it cleaned, and
then very concisely report your results. And once again: do
not forget the principle of IWYU: not all removals that
compile are good. If a file is using a symbol, it should
include it or forward-define it, not rely on transitive
includes. Remove what should be removed, add what should be
added.

View File

@@ -1,4 +1,5 @@
#include "WingCommandlet.h"
#include "CoreMinimal.h"
#include "WingServer.h"
#include "Containers/Ticker.h"

View File

@@ -1,10 +1,8 @@
#include "WingComponent.h"
#include "WingTypes.h"
#include "WingUtils.h"
#include "Engine/Blueprint.h"
#include "Engine/SCS_Node.h"
#include "Engine/SimpleConstructionScript.h"
#include "Components/ActorComponent.h"
#include "Components/SceneComponent.h"
#include "GameFramework/Actor.h"
#include "Kismet2/BlueprintEditorUtils.h"

View File

@@ -1,4 +1,5 @@
#include "WingGraphExport.h"
#include "WingProperty.h"
#include "WingTypes.h"
#include "WingUtils.h"
#include "EdGraph/EdGraph.h"

View File

@@ -2,6 +2,7 @@
#include "WingServer.h"
#include "WingBasics.h"
#include "WingTypes.h"
#include "WingUtils.h"
void WingManual::PrintHandlerPrototype(const FWingHandlerConfig& Handler)
{

View File

@@ -1,4 +1,5 @@
#include "WingParameterEditor.h"
#include "Materials/MaterialInstanceConstant.h"
#include "WingUtils.h"
#include "WingTokenizer.h"
#include "WingProperty.h"

View File

@@ -1,57 +1,14 @@
#include "WingServer.h"
#include "WingBasics.h"
#include "WingProperty.h"
#include "WingManual.h"
#include "WingLogCapture.h"
#include "WingUtils.h"
#include "UObject/StrongObjectPtr.h"
#include "AssetRegistry/AssetRegistryModule.h"
#include "AssetRegistry/IAssetRegistry.h"
#include "Engine/Blueprint.h"
#include "EdGraph/EdGraph.h"
#include "EdGraph/EdGraphNode.h"
#include "EdGraph/EdGraphPin.h"
#include "EdGraphSchema_K2.h"
#include "K2Node.h"
#include "K2Node_CallFunction.h"
#include "K2Node_VariableGet.h"
#include "K2Node_VariableSet.h"
#include "K2Node_BreakStruct.h"
#include "K2Node_MakeStruct.h"
#include "K2Node_MacroInstance.h"
#include "K2Node_DynamicCast.h"
#include "K2Node_CallParentFunction.h"
#include "K2Node_IfThenElse.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "Kismet2/KismetEditorUtilities.h"
#include "Serialization/JsonReader.h"
#include "Serialization/JsonSerializer.h"
#include "SocketSubsystem.h"
#include "Sockets.h"
#include "Async/Async.h"
#include "Misc/Paths.h"
#include "Misc/FileHelper.h"
#include "Misc/Guid.h"
#include "UObject/UObjectIterator.h"
#include "Misc/PackageName.h"
#include "Editor.h"
// Animation Blueprint support
#include "Animation/AnimBlueprint.h"
#include "Animation/AnimBlueprintGeneratedClass.h"
#include "Animation/Skeleton.h"
#include "AnimGraphNode_StateMachine.h"
#include "AnimGraphNode_AssetPlayerBase.h"
#include "AnimGraphNode_SequencePlayer.h"
#include "AnimGraphNode_BlendSpacePlayer.h"
#include "AnimGraphNode_Base.h"
#include "AnimStateNode.h"
#include "AnimStateTransitionNode.h"
#include "AnimStateConduitNode.h"
#include "AnimStateEntryNode.h"
#include "AnimationStateMachineGraph.h"
#include "AnimationGraph.h"
#include "AnimationTransitionGraph.h"
UWingServer* UWingServer::GWingServer = nullptr;

View File

@@ -3,7 +3,8 @@
#include "ToolMenuEntry.h"
#include "ToolMenuDelegates.h"
#include "ToolMenuContext.h"
#include "ToolMenus.h"
#include "ToolMenu.h"
#include "ToolMenuSection.h"
#include "WingUtils.h"
#include "EdGraphSchema_K2.h"
#include "Framework/Commands/UIAction.h"

View File

@@ -1,28 +1,15 @@
#include "WingUtils.h"
#include "WingComponent.h"
#include "WingProperty.h"
#include "WingTypes.h"
#include "WingServer.h"
#include "WingBasics.h"
#include "WingTokenizer.h"
#include "PropertyHandle.h"
#include "Engine/Blueprint.h"
#include "Engine/MemberReference.h"
#include "Engine/World.h"
#include "Components/ActorComponent.h"
#include "Engine/SCS_Node.h"
#include "EdGraph/EdGraph.h"
#include "EdGraph/EdGraphNode.h"
#include "EdGraph/EdGraphPin.h"
#include "K2Node_EditablePinBase.h"
#include "EdGraph/EdGraphSchema.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "Kismet2/Kismet2NameValidators.h"
#include "Kismet2/KismetEditorUtilities.h"
#include "UObject/UObjectIterator.h"
#include "UObject/UnrealType.h"
#include "Misc/Paths.h"
#include "Misc/PackageName.h"
// Reparent validation
#include "Engine/LevelScriptActor.h"
@@ -36,7 +23,6 @@
// Material support
#include "Materials/Material.h"
#include "Materials/MaterialExpression.h"
#include "Materials/MaterialFunction.h"
#include "Materials/MaterialInstanceConstant.h"
#include "MaterialGraph/MaterialGraph.h"

View File

@@ -3,12 +3,13 @@
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "UObject/StrongObjectPtr.h"
#include "Dom/JsonObject.h"
#include "WingBasics.generated.h"
class UEdGraphNode;
class UEdGraphPin;
class UBlueprint;
class FJsonObject;
class FJsonValue;
////////////////////////////////////////////////////////////
//

View File

@@ -1,6 +1,5 @@
#pragma once
#include "CoreMinimal.h"
#include "Commandlets/Commandlet.h"
#include "WingCommandlet.generated.h"

View File

@@ -1,12 +1,14 @@
#pragma once
#include "CoreMinimal.h"
#include "WingBasics.h"
class UBlueprint;
class USCS_Node;
class UActorComponent;
class USimpleConstructionScript;
class UClass;
class UWingComponentReference;
class WingOut;
struct UWingComponent

View File

@@ -1,12 +1,11 @@
#pragma once
#include "CoreMinimal.h"
#include "Factories/Factory.h"
#include "Factories/EnumFactory.h"
#include "WingBasics.h"
#include "WingFactories.generated.h"
class UFactory;
class WingFactories
{
@@ -58,4 +57,4 @@ class UEnumFactoryWing : public UEnumFactory
GENERATED_BODY()
public:
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
};
};

View File

@@ -4,8 +4,6 @@
#include "UObject/StrongObjectPtr.h"
#include "WingBasics.h"
struct FWalker;
// WingFetcher: Load an Asset and find an object within it.
// To find an object, you use a path. This is typical:
//

View File

@@ -1,11 +1,11 @@
#pragma once
#include "CoreMinimal.h"
#include "WingProperty.h"
#include "EdGraph/EdGraphPin.h"
class UEdGraph;
class UEdGraphNode;
struct FWingProperty;
class WingGraphExport
{

View File

@@ -1,6 +1,8 @@
#pragma once
#include "Containers/Set.h"
#include "WingBasics.h"
#include "CoreMinimal.h"
struct FWingHandlerConfig;
enum class EWingHandlerKind;
class WingManual
{

View File

@@ -1,11 +1,12 @@
#pragma once
#include "CoreMinimal.h"
#include "Materials/Material.h"
#include "Materials/MaterialInstanceConstant.h"
#include "MaterialTypes.h"
#include "WingBasics.h"
#include "WingParameterEditor.generated.h"
class UMaterialInterface;
class UMaterialInstanceConstant;
struct WingTokenizer;
USTRUCT()

View File

@@ -2,7 +2,6 @@
#include "CoreMinimal.h"
#include "EditorSubsystem.h"
#include "Tickable.h"
#include "TickableEditorObject.h"
#include "Async/Future.h"
#include "WingNotifier.h"

View File

@@ -2,11 +2,11 @@
#include "CoreMinimal.h"
#include "EditorSubsystem.h"
#include "EdGraph/EdGraphPin.h"
#include "WingBasics.h"
#include "WingTypes.generated.h"
struct FAssetData;
struct FEdGraphPinType;
struct WingTokenizer;
// ---------------------------------------------------------------------------

View File

@@ -2,11 +2,10 @@
#include "CoreMinimal.h"
#include "EdGraph/EdGraph.h"
#include "EdGraph/EdGraphNode.h"
#include "EdGraph/EdGraphPin.h"
#include "Materials/MaterialExpression.h"
#include "MaterialTypes.h"
#include "Components/ActorComponent.h"
#include "Engine/SCS_Node.h"
#include "Engine/MemberReference.h"
#include "Engine/Blueprint.h"
#include "K2Node_EditablePinBase.h"
@@ -20,6 +19,7 @@ class UAnimSequence;
class UAnimStateNode;
class UAnimStateTransitionNode;
class UBlendSpace;
class USCS_Node;
class IPropertyHandle;
class UScriptStruct;
class UEnum;

View File

@@ -6,6 +6,7 @@
struct FBPVariableDescription;
struct WingTokenizer;
class UObject;
class UBlueprint;
class UEdGraph;
class UK2Node_CustomEvent;

View File

@@ -1,10 +1,11 @@
#pragma once
#include "CoreMinimal.h"
#include "UObject/SoftObjectPtr.h"
#include "WingBasics.h"
class UClass;
class UWidget;
class UWidgetTree;
struct FAssetData;

View File

@@ -3,12 +3,14 @@
Usage:
python3 tools/clangd-query.py symbol <name>
python3 tools/clangd-query.py diagnostics <file>
python3 tools/clangd-query.py definition <file> <line> <col>
python3 tools/clangd-query.py references <file> <line> <col>
python3 tools/clangd-query.py stop
Commands:
symbol <name> Search for symbols by name across the project.
diagnostics <file> Report clangd diagnostics for a file.
definition <file> <line> <col> Find where a symbol is defined.
references <file> <line> <col> Find all references to a symbol.
stop Stop the background daemon.
@@ -22,15 +24,15 @@ Examples:
How it works:
The first invocation starts a background clangd daemon process. It loads
the project index from .vscode/.cache/clangd/index/ (shared with VS Code's
clangd). This takes ~10 seconds. Subsequent queries hit the warm daemon
and return in milliseconds.
the project through a dedicated .clangd-query compile-commands directory,
which gives it a separate clangd cache. This takes ~10 seconds.
Subsequent queries hit the warm daemon and return in milliseconds.
Clangd configuration (binary path, flags) is read from
Integration.code-workspace so it stays in sync with VS Code.
The daemon writes its PID to .clangd-query.pid and listens on a Unix
socket at .clangd-query.sock. Use 'stop' to shut it down, or just kill
The daemon writes its PID to .clangd-query/pid and listens on a Unix
socket at .clangd-query/sock. Use 'stop' to shut it down, or just kill
the PID. Starting a new daemon automatically kills any existing one.
"""