Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds a base symbolgraph for Snippets test fixture #1160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

heckj
Copy link
Member

@heckj heckj commented Feb 16, 2025

Summary

Supports fixing an issue confusing snippets as both "main" and "extension" symbolgraphs for a particular module. The fix in swift-docc-symbolkit fails this specific fixture since it doesn't currently have a "main" graph, even empty as this one, to extend from. With this in place, the tests fully pass for properly resolving snippets symbolgraphs reliably.

related to fix for swift-docc-symbolkit#88

Dependencies

none - this is a dependency for a fix in swift-docc-symbolkit

Testing

Ran unit tests with existing main branch as well as branch for fix in symbol kit.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests (updated a test)
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

Supports fixing an issue confusing snippets as both "main" and "extension"
symbolgraphs for a particular module. The fix in swift-docc-symbolkit
fails this specific fixture since it doesn't currently have a "main"
graph, even empty as this one, to extend from. With this in place, the
tests fully pass for properly resolving snippets symbolgraphs reliably.
@heckj
Copy link
Member Author

heckj commented Feb 16, 2025

For fuller detail, the changes in swiftlang/swift-docc-symbolkit#95 changes the symbolgraph loader for *-snippet.symbolgraph.json files to load them as extensions to some existing symbolgraph. The idea in the loader being that there's a "main" symbolgraph for a module, and extensions - and symbol graphs from snippets are always expected to be extensions on some other main module.

The Snippets test fixture, used in ~10-12 tests in swift-docc, didn't maintain that assumption and had only a single symbolgraph included within it, so when the PR to change the loader was merged, the tests that all used this fixture started breaking, failing to resolve the "main" module symbols because there wasn't a "main" symbolgraph loaded.

This PR adds a "main" module (Snippets in this case), with no symbols - just a main structure that can be extended, which matches the current execution scenario of if you had a bare package with no source, but added snippets into it.

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please test

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.

2 participants