Skip to content

Conversation

@d-ronnqvist
Copy link
Contributor

@d-ronnqvist d-ronnqvist commented Oct 31, 2025

Bug/issue #, if applicable:

Summary

This extracts the SourceLanguage type and the Synchronized type into a new "Common" target.

The purpose of this change is to make it easier for other new code to be written in other new special purpose targets. And to be able to adopt stricter compile time checks in some new code that we can't yet enable in the full SwiftDocC target.

Dependencies

None.

Testing

Nothing in particular. This isn't a user facing

Checklist

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

  • [ ] Added tests
  • Ran the ./bin/test script and it succeeded
  • [ ] Updated documentation if necessary

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

I'm marking this as a draft while I perform a bit more compatibility testing to know if it's fine to move these public types or if we should leave a public typealias to these types instead?

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist marked this pull request as ready for review November 7, 2025 12:47
@d-ronnqvist
Copy link
Contributor Author

I'm marking this as a draft while I perform a bit more compatibility testing to know if it's fine to move these public types or if we should leave a public typealias to these types instead?

I found that we needed to add public typealias SourceLanguage = Common.SourceLanguage for compatibility, so I made that change in 72254fa. This is ready to review now.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist force-pushed the create-target-for-common-code branch from 607d02e to 04d9cc1 Compare November 10, 2025 10:01
@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

*/

/// A programming language.
public struct SourceLanguage: Hashable, Codable, Comparable, Sendable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you added Sendable conformance here, vs. the previous version in Sources/SwiftDocC/Model/SourceLanguage.swift. Was that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can see that that was made in 04a7964 after moving the code. Conforming to Sendable here is necessary for the stricter concurrency checks in the Swift 6 language mode that the same commit enables for this new target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the SourceLanguage file that was in SwiftDocC to CommonTypeExports so that git would produce a better diff for these changes.


// A few common types and core functionality that's useable by all other targets.
.target(
name: "DocCCommon",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to #1345 I added a "DocC" prefix to this target so as to not conflict with any other target in the toolchain.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 70a8a0d into swiftlang:main Nov 14, 2025
2 checks passed
@d-ronnqvist d-ronnqvist deleted the create-target-for-common-code branch November 14, 2025 16:56
AnthonyLatsis added a commit to AnthonyLatsis/sourcekit-lsp that referenced this pull request Nov 15, 2025
bnbarham added a commit to swiftlang/sourcekit-lsp that referenced this pull request Nov 15, 2025
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