Skip to content

Some elements containing keywords in name are not well colored #963

@pylapp

Description

@pylapp

Description

Description

When I have enums values like asset only set is colored. FMPOV asset should be colored globaly or not at all.

Swift code samples

Assuming I havz a Swift enum like:

    /// Type of icon in an `OUDSTag`
    public enum Icon {
        /// The tag has a bullet as icon
        case bullet

        /// The tag has an image as icon
        case asset(Image)
    }

And the DocC documentation sample like:

///     // Text only with neutral status, for emphasized hierarchy with rounded shape in default size
///     OUDSTag(label: "Label", hierarchy: .emphasized, status: .neutral, shape: .rounded, size: .default)
///     // Or also
///     OUDSTag(label: "Label")
///
///     // Text with bullet and negative status, using default hierarchy (emphasized), shape (rounded) and size (default)
///     OUDSTag(label: "Label", icon: .bullet, status: .negative)
///
///     // Tag with label and icon with image
///     OUDSTag(label: "Label", icon: .asset(Image("ic_heart")))
///
///     // Tag with label and loader, but defined with an image which won't be displayed while loader is active
///     OUDSTag(label: "Label", icon: .asset(Image("ic_heart")), hasLoader: true)
///
///     // If your layout is in RTL model but your tag has an icon with another meaning because of bad orientation,
///     // you can flip the icon
///     OUDSTag(label: "Label", icon: .asset(Image("ic_heart")), flipIcon: true)

For the .asset objects only set is colored in red instead of the whole word or not the word at all.
This visual rendrring is a bit confusing.

Rendering

Both Xcode rendering and web rendering have the issue.
Web page is live here with the rendering below.

Image

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

.asset should not be colored like all other enums, or instead all enums must be colored

Actual behavior

.asset is partially colored

Steps To Reproduce

Environment

  • Xcode version 16.3 (16E140)
  • macOS Sequoia 15.6 (24G84)

Swift-DocC Version Information

I do not know how to get it

Swift Compiler Version Information

swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: x86_64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions