-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SourceKit] Update for primary associated types #58973
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
[SourceKit] Update for primary associated types #58973
Conversation
* InterfaceGen reports a primary associated type as a reference to the 'associatedtype' declaration * CursorInfo on a primary associated type returns information of the 'associatedtype' declaration rdar://93275458
59172c9
to
8bda524
Compare
@swift-ci Please smoke test |
@QuietMisdreavus With this change, Could you double check? Let me know you need additional test, or you can add test cases for SymbolGraph after merging it as you need. |
@rintaro Can you take the snippet you're using for Index and SourceKit tests and use it in a SymbolGraph test? I can build up a specific one tomorrow if you need, but copying the build lines from something like |
@QuietMisdreavus Does this look good? If it looks good, let me merge this as is, and could you add a test case after that if needed? // RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name MyModule -emit-module -emit-module-path %t/
// RUN: %target-swift-symbolgraph-extract -module-name MyModule -I %t -pretty-print -output-dir %t
public protocol WithPrimary<Assoc> {
associatedtype Assoc
} Result {
"metadata": {
"formatVersion": {
"major": 0,
"minor": 5,
"patch": 3
},
"generator": "Swift version 5.8-dev (LLVM 278d67f38c6a910, Swift 4ae16bfef7bb240)"
},
"module": {
"name": "MyModule",
"platform": {
"architecture": "x86_64",
"vendor": "apple",
"operatingSystem": {
"name": "macosx",
"minimumVersion": {
"major": 10,
"minor": 9,
"patch": 0
}
}
}
},
"symbols": [
{
"kind": {
"identifier": "swift.protocol",
"displayName": "Protocol"
},
"identifier": {
"precise": "s:8MyModule11WithPrimaryP",
"interfaceLanguage": "swift"
},
"pathComponents": [
"WithPrimary"
],
"names": {
"title": "WithPrimary",
"navigator": [
{
"kind": "identifier",
"spelling": "WithPrimary"
}
],
"subHeading": [
{
"kind": "keyword",
"spelling": "protocol"
},
{
"kind": "text",
"spelling": " "
},
{
"kind": "identifier",
"spelling": "WithPrimary"
}
]
},
"declarationFragments": [
{
"kind": "keyword",
"spelling": "protocol"
},
{
"kind": "text",
"spelling": " "
},
{
"kind": "identifier",
"spelling": "WithPrimary"
},
{
"kind": "text",
"spelling": "<"
},
{
"kind": "typeIdentifier",
"spelling": "Assoc"
},
{
"kind": "text",
"spelling": ">"
}
],
"accessLevel": "public"
},
{
"kind": {
"identifier": "swift.associatedtype",
"displayName": "Associated Type"
},
"identifier": {
"precise": "s:8MyModule11WithPrimaryP5AssocQa",
"interfaceLanguage": "swift"
},
"pathComponents": [
"WithPrimary",
"Assoc"
],
"names": {
"title": "Assoc",
"subHeading": [
{
"kind": "keyword",
"spelling": "associatedtype"
},
{
"kind": "text",
"spelling": " "
},
{
"kind": "identifier",
"spelling": "Assoc"
}
]
},
"declarationFragments": [
{
"kind": "keyword",
"spelling": "associatedtype"
},
{
"kind": "text",
"spelling": " "
},
{
"kind": "identifier",
"spelling": "Assoc"
}
],
"accessLevel": "public"
}
],
"relationships": [
{
"kind": "requirementOf",
"source": "s:8MyModule11WithPrimaryP5AssocQa",
"target": "s:8MyModule11WithPrimaryP"
}
]
} |
@rintaro That looks great, thanks! I can add the test once this is merged. |
rdar://93275458