SourceDocs icon indicating copy to clipboard operation
SourceDocs copied to clipboard

Static members of enums and structs not documented

Open appfrilans opened this issue 4 years ago • 4 comments

Brief Description

SourceDocs does not seems to support "caseless enums" or static members of structs

Steps to Reproduce

Create a swift file with this content:

/**
 A description here 1
 */
public struct Constants {
    /**
     A description here 2
     */
    public static let myContant = "constant"
}

or

/**
 A description here 3
 */
public enum Constants {
    /**
     A description here 4
     */
    public static let myContant = "constant"
}
  1. Step 2
  2. Step 3

Expected Outcome

For the "A description here 2" to appear in the corresponding generated documentation.

Actual Outcome

The static constant is not mentionedin the documentation file for Constants

Environment

  • Operating System: macOS 11.1
  • Xcode Version: 12.3
  • SwiftDocs Version/SHA: SourceDocs v1.2.1
  • Swift version: 5.0

Additional Comments

Demo Project

appfrilans avatar Jan 20 '21 12:01 appfrilans

Seems to be an issue for classes as well. All static let is ignored

appfrilans avatar Jan 20 '21 12:01 appfrilans

Ah, good point, will have to look into this. Thanks for bringing this up.

eneko avatar Jan 21 '21 00:01 eneko

Same for extension with static var. I have an extension with only a static var inside. This file has been ignored for documentation. But if I add a method in this extension I will not be ignored. The keyword static associated with var seems to be the problem. Works with static func

MathisDetourbet avatar Jan 25 '21 15:01 MathisDetourbet

Thanks for the follow up, that is useful.

eneko avatar Jan 25 '21 17:01 eneko