Add C-family (Objective-C/C/C++) declaration parsing support

Extends symbol extraction to mixed Swift+C-family packages via clangd
multiplexing through sourcekit-lsp: new CFamilyDeclarationParser,
CompilationDatabaseWriter, ObjectiveCShimWriter, SourceLanguage detection,
PathFilter, and ShapeSnapshot, plus a shared DeclarationParser contract and
build/test scripts.
This commit is contained in:
2026-06-15 16:27:19 -04:00
parent 609e63671f
commit 4aee51762a
14 changed files with 1633 additions and 203 deletions
Executable
+53
View File
@@ -0,0 +1,53 @@
#!/bin/bash
set -u
LIBAVCODEC_MAJOR=$(pkg-config --modversion libavcodec 2>/dev/null | cut -d. -f1)
export LIBAVCODEC_MAJOR="${LIBAVCODEC_MAJOR:-0}"
OUTFILE=$(mktemp /tmp/test_output_XXXXXX.txt)
START_TIME=$SECONDS
TEST_FILTER="${1:-}"
shift $(( $# > 0 ? 1 : 0 ))
SWIFT_TEST_ARGS=()
if [ -n "$TEST_FILTER" ]; then
SWIFT_TEST_ARGS+=(--filter "$TEST_FILTER")
fi
if [ $# -gt 0 ]; then
SWIFT_TEST_ARGS+=("$@")
fi
swift test "${SWIFT_TEST_ARGS[@]}" >"$OUTFILE" 2>&1
STATUS=$?
ELAPSED=$((SECONDS - START_TIME))
if [ -n "$TEST_FILTER" ]; then
echo "Filter: $TEST_FILTER"
else
echo "Filter: all tests"
fi
SUMMARY_LINE=$(
grep -E "Executed [0-9]+ test(s)?, with [0-9]+ failures" "$OUTFILE" | tail -1
)
SUITE_RESULT_LINE=$(
grep -E "Test Suite '([^']+|Selected tests|All tests)' (passed|failed)" "$OUTFILE" | tail -1
)
if [ -n "$SUMMARY_LINE" ]; then
TOTAL_TESTS=$(printf '%s\n' "$SUMMARY_LINE" | awk '{print $2}')
TOTAL_FAILURES=$(printf '%s\n' "$SUMMARY_LINE" | awk '{print $5}')
echo "Total: $TOTAL_TESTS Failures: $TOTAL_FAILURES"
else
echo "Total: unknown Failures: unknown"
fi
if [ -n "$SUITE_RESULT_LINE" ]; then
echo "Result: $SUITE_RESULT_LINE"
fi
echo "Elapsed: ${ELAPSED}s"
echo "Build / compile errors:"
grep -E "^/home/$(whoami)/Projects/CodeMapper/(Sources|Tests)/.*error:" "$OUTFILE" | sed "s|/home/$(whoami)/Projects/CodeMapper/||" | head -10 || echo " none"
echo "Failed / crashed:"
grep "FAILED\|Fatal error\|Exited with unexpected\| failed (" "$OUTFILE" || echo " none"
echo "Full output: $OUTFILE"
exit $STATUS