Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Color layer property documentation refers to UIColor #11573

Closed
1ec5 opened this issue Mar 30, 2018 · 2 comments
Closed

Color layer property documentation refers to UIColor #11573

1ec5 opened this issue Mar 30, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Mar 30, 2018

#10726 removed some code that previously switched between NSColor and UIColor based on the platform, so now color-typed style layer properties are documented to take instances of UIColor on both iOS and macOS, instead of UIColor on iOS and NSColor on macOS:

* Constant `UIColor` values

The code generation script needs to duplicate color-typed property declarations and their documentation comments and use conditional compilation to switch between the two types.

/cc @jmkiley @fabian-guerra

@1ec5 1ec5 added macOS Mapbox Maps SDK for macOS documentation labels Mar 30, 2018
@1ec5 1ec5 added this to the macos-v0.7.0 milestone Mar 30, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Mar 30, 2018

Actually, the code is still there, but the issue is that the regular expressions are matching occurrences of “MGLColor” or “UIColor” that occur outside of the documentation comment, in the declaration:

// Look for a documentation comment that contains “MGLColor” or “UIColor”
// and the subsequent function, method, or property declaration. Try not to
// match greedily.
return src.replace(/(\/\*\*(?:\*[^\/]|[^*])*?\*\/)(\s*[^;]+?\b(?:MGL|NS|UI)(?:Color|EdgeInsets(?:Zero)?)\b[^;]+?;)/g,
(match, comment, decl) => {

// Do the same for CGVector-typed properties.
.replace(/(\/\*\*(?:\*[^\/]|[^*])*?\b(?:CGVector|UIEdgeInsets(?:Zero)?)\b[\s\S]*?\*\/)(\s*.+?;)/g,

The migration to NSExpression means that the declared type is just NSExpression *, no longer MGLStyleValue<MGLColor *> *. The regular expressions will need to be rewritten to look for “UIColor” within the comment itself.

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 16, 2018

Fixed in #11694 on the release-boba branch for macOS map SDK v0.7.0.

@1ec5 1ec5 closed this as completed Apr 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants