Skip to content

Commit

Permalink
Revert "Fix used extension check false positive from usused object or…
Browse files Browse the repository at this point in the history
… behavior events (#7331)" (#7340)

This reverts commit cb24f19.

Don't show in changelog
  • Loading branch information
D8H authored Jan 23, 2025
1 parent 872f403 commit 56ab2fd
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions Core/GDCore/IDE/Events/UsedExtensionsFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,9 @@ bool UsedExtensionsFinder::DoVisitInstruction(gd::Instruction& instruction,
project.GetCurrentPlatform(), instruction.GetType())
: gd::MetadataProvider::GetExtensionAndActionMetadata(
project.GetCurrentPlatform(), instruction.GetType());
// Unused event-based objects or events-based behaviors may use object and
// behavior instructions that should not be detected as extension usage.
// The extension of actually used objects and behaviors will be detected on
// scene objects. This is why object or behavior instructions usually don't
// have any import.
if (!metadata.GetMetadata().GetIncludeFiles().empty()) {
result.AddUsedExtension(metadata.GetExtension());
for (auto &&includeFile : metadata.GetMetadata().GetIncludeFiles()) {
result.AddUsedIncludeFiles(includeFile);
}
result.AddUsedExtension(metadata.GetExtension());
for (auto&& includeFile : metadata.GetMetadata().GetIncludeFiles()) {
result.AddUsedIncludeFiles(includeFile);
}

gd::ParameterMetadataTools::IterateOverParameters(
Expand Down Expand Up @@ -206,16 +199,9 @@ void UsedExtensionsFinder::OnVisitFunctionCallNode(FunctionCallNode& node) {
return;
}

// Unused event-based objects or events-based behaviors may use object and
// behavior expressions that should not be detected as extension usage.
// The extension of actually used objects and behaviors will be detected on
// scene objects. This is why object or behavior expressions usually don't
// have any import.
if (!metadata.GetMetadata().GetIncludeFiles().empty()) {
result.AddUsedExtension(metadata.GetExtension());
for (auto &&includeFile : metadata.GetMetadata().GetIncludeFiles()) {
result.AddUsedIncludeFiles(includeFile);
}
result.AddUsedExtension(metadata.GetExtension());
for (auto&& includeFile : metadata.GetMetadata().GetIncludeFiles()) {
result.AddUsedIncludeFiles(includeFile);
}
};

Expand Down

0 comments on commit 56ab2fd

Please sign in to comment.