Skip to content

Commit 12968b9

Browse files
Merge pull request #487 from tannergooding/main
Ensure --include works for whole records and so on
2 parents 8175981 + 64ee00e commit 12968b9

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,16 +4699,21 @@ bool IsExcludedByName(Cursor cursor, ref uint isExcludedValue)
46994699
}
47004700

47014701
if (_config.IncludedNames.Count != 0 && !_config.IncludedNames.Contains(qualifiedName)
4702-
&& !_config.IncludedNames.Contains(dottedQualifiedName)
4703-
&& !_config.IncludedNames.Contains(qualifiedNameWithoutParameters)
4704-
&& !_config.IncludedNames.Contains(dottedQualifiedNameWithoutParameters)
4705-
&& !_config.IncludedNames.Contains(name))
4702+
&& !_config.IncludedNames.Contains(dottedQualifiedName)
4703+
&& !_config.IncludedNames.Contains(qualifiedNameWithoutParameters)
4704+
&& !_config.IncludedNames.Contains(dottedQualifiedNameWithoutParameters)
4705+
&& !_config.IncludedNames.Contains(name))
47064706
{
4707-
if (_config.LogExclusions)
4707+
var semanticParentCursor = cursor.SemanticParentCursor;
4708+
4709+
if ((semanticParentCursor is null) || IsExcluded(semanticParentCursor) || IsAlwaysIncluded(semanticParentCursor))
47084710
{
4709-
AddDiagnostic(DiagnosticLevel.Info, $"Excluded {kind} '{qualifiedName}' as it was not in the include list");
4711+
if (_config.LogExclusions)
4712+
{
4713+
AddDiagnostic(DiagnosticLevel.Info, $"Excluded {kind} '{qualifiedName}' as it was not in the include list");
4714+
}
4715+
return true;
47104716
}
4711-
return true;
47124717
}
47134718

47144719
if ((isExcludedValue & 0b10) != 0)

0 commit comments

Comments
 (0)