Add per-operation hooks for framework diagnostics by GtechGovind · Pull Request #850 · jpsim/SourceKitten · GitHub
Skip to content

Add per-operation hooks for framework diagnostics - #850

Open
GtechGovind wants to merge 2 commits into
jpsim:mainfrom
GtechGovind:fix/diagnostic-event-hook
Open

GtechGovind wants to merge 2 commits into
jpsim:mainfrom
GtechGovind:fix/diagnostic-event-hook

Conversation

@GtechGovind

Copy link
Copy Markdown

Summary

I added per-operation EventHook values so framework consumers can collect progress and diagnostic messages without writing them to stderr.

  • Preserve existing initializer signatures and default stderr behavior.
  • Propagate hooks through module builds, deferred documentation, file reads, and Clang header processing.
  • Invoke file-read callbacks outside cache locks, including callbacks that read, replace, or invalidate cached contents.
  • Document synchronous callback behavior and the boundaries: raw subprocess output and process-wide SourceKit restoration notifications remain unchanged.

Addresses #22.

Validation

  • swift test --filter EventHookTests: 19 tests passed.
  • swift build -c release: passed.
  • SwiftLint 0.58.2 lint --strict: zero violations across 79 files.
  • swift test: 95 tests, six failures. An untouched checkout of the same upstream commit has 76 tests and the same six failures on this host (Xcode 27.0 / Swift 6.4): ModuleTests.testCommandantDocs, ModuleTests.testCommandantDocsSPM, ModuleTests.testSpmDefaultModule, SourceKitTests.testIndex, SourceKitTests.testSwiftDeclarationAttributeKind, and SwiftDocsTests.testBicycle. These involve the legacy Xcode sample, SwiftPM build-manifest compatibility, and compiler-dependent fixtures.
  • xcodebuild -scheme SourceKitten-Package -parallel-testing-enabled NO test -destination platform=macOS: built and began running tests, but stalled for over five minutes in the existing ClangTranslationUnitTests.testBasicObjectiveCDocs; I stopped the run. It is not a completed validation result.
  • Linux and Bazel validation were not run locally.

@GtechGovind
GtechGovind marked this pull request as ready for review October 2, 2026 09:45
…t-hook

# Conflicts:
#	Source/SourceKittenFramework/Module.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant