Skip to content

Add support for 'union' symbol kinds #785

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

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -214,6 +214,7 @@ extension AutomaticCuration {
case .`typeProperty`: return "Type Properties"
case .`typeSubscript`: return "Type Subscripts"
case .`typealias`: return "Type Aliases"
case .union: return "Unions"
case .`var`: return "Variables"
case .module: return "Modules"
case .extendedModule: return "Extended Modules"
Expand All @@ -236,6 +237,7 @@ extension AutomaticCuration {
.`class`,
.`protocol`,
.`struct`,
.`union`,
.`httpRequest`,
.`dictionary`,
.`var`,
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftDocC/Model/DocumentationNode.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021-2023 Apple Inc. and the Swift project authors
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -527,6 +527,7 @@ public struct DocumentationNode {
case .`typeProperty`: return .typeProperty
case .`typeSubscript`: return .typeSubscript
case .`typealias`: return .typeAlias
case .union: return .union
case .`var`: return .globalVariable
case .module: return .module
case .extendedModule: return .extendedModule
Expand Down
13 changes: 8 additions & 5 deletions Tests/SwiftDocCTests/Infrastructure/AutomaticCurationTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -551,13 +551,13 @@ class AutomaticCurationTests: XCTestCase {
)
}

func testNamespacesAreCuratedProperly() throws {
let (bundle, context) = try testBundleAndContext(named: "CxxNamespaces")
func testCPlusPlusSymbolsAreCuratedProperly() throws {
let (bundle, context) = try testBundleAndContext(named: "CxxSymbols")

let rootDocumentationNode = try context.entity(
with: .init(
bundleIdentifier: bundle.identifier,
path: "/documentation/CxxNamespaces",
path: "/documentation/CxxSymbols",
sourceLanguage: .objectiveC
)
)
Expand All @@ -573,7 +573,10 @@ class AutomaticCurationTests: XCTestCase {
},
[
"Namespaces",
"/documentation/CxxNamespaces/Foo",
"/documentation/CxxSymbols/Foo",

"Unions",
"/documentation/CxxSymbols/MyUnion",
]
)
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ``CxxSymbols``

This bundle contains a small symbol graph that demonstrates symbol kinds added in Clang's C++
support as currently reflected on its main branch.

<!-- Copyright (c) 2023-2024 Apple Inc and the Swift Project authors. All Rights Reserved. -->
Loading