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

[SR-15414] DocC can't refer to Identifiable id property #209

Closed
swift-ci opened this issue Oct 30, 2021 · 4 comments
Closed

[SR-15414] DocC can't refer to Identifiable id property #209

swift-ci opened this issue Oct 30, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@swift-ci
Copy link

Previous ID SR-15414
Radar None
Original Reporter rnikander (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Swift-DocC
Labels Bug
Assignee None
Priority Medium

md5: c52b0f49f42bf64ff30b67f218f38502

Issue Description:

I noticed this in a more complicated situation, when I could not put my id property in my Topics section, to control where it appears. The following is a boiled down example. I included CustomStringConvertible and description, because oddly DocC is fine with that one.

/// I can't talk about  ``id`` but I can talk about ``description``. 
public struct FooBar: CustomStringConvertible, Identifiable {
    /// doc 1
    public var id: String
    /// doc 2
    public var foo: Int
    /// doc 3
    public var description: String
}

The compiler does not like the ``id``. It says:

Topic reference 'id' couldn't be resolved to known documentation

The rendered documentation has a nice link for description but not for id.

@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Oct 31, 2021

Reproduced.

Using the sample code below, and reference these property in DocC's Topics.

A/id and C/description are fine. B/id and C/id are complaining -> "Topic reference 'B/id' couldn't be resolved to known documentation"

public struct A {
    public var id: String
}

public struct B: Identifiable {
    public var id: String
}

public struct C: CustomStringConvertible, Identifiable {
    public var id: String
    public var description: String
}

I'm investigating the code to find what's wrong.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 3, 2022
@JeneaVranceanu
Copy link

JeneaVranceanu commented Jul 15, 2022

Xcode Version 13.3 (13E113)

Probably related:

Topic reference 'Web3/Utils/erc20ABI' couldn't be resolved. No local documentation matches this reference.

Breakdown

erc20ABI is a public static var declared in an extension of Web3.Utils which is a struct.
The Web3.Utils is declared in an extension.

public struct Web3 {
}

extension Web3 {
    public struct Utils {
    }
}

extension Web3.Utils {
    /// Note that this variable does have a documentation comment, but it's not resolved.
    public static var erc20Abi = "some value here"
}

But at the same time, this variable is resolved by Xcode and by Cmd+Click can navigate to the declaration source.

Screenshot 2022-07-15 at 12 20 44

@d-ronnqvist
Copy link
Contributor

All 3 examples in this thread work for me in the latest main and 5.9 builds of DocC.

@d-ronnqvist
Copy link
Contributor

Feel free to reopen this issue and add more examples if there are cases where this doesn't work with the latest main or 5.9 builds of DocC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants