From a0cb1f2f01c1c7ab862f5ee69ec924a0ecaa5d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 5 Jan 2018 17:37:18 -0800 Subject: [PATCH] [ios, macos] Update cross-refs to properties in doc comments --- platform/darwin/scripts/generate-style-code.js | 10 ++++++---- platform/darwin/src/MGLCircleStyleLayer.h | 4 ++-- .../darwin/src/MGLFillExtrusionStyleLayer.h | 4 ++-- platform/darwin/src/MGLFillStyleLayer.h | 4 ++-- platform/darwin/src/MGLLineStyleLayer.h | 4 ++-- platform/darwin/src/MGLSymbolStyleLayer.h | 18 +++++++++--------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index ced483fbba5..ac1527eb325 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -27,8 +27,10 @@ _.forOwn(cocoaConventions, function (properties, kind) { delete spec[kind][oldName]; spec[kind][newName] = property; - // Update requirements in other properties. - let updateRequirements = function (property, name) { + // Update cross-references to this property in other properties' + // documentation and requirements. + let renameCrossReferences = function (property, name) { + property.doc = property.doc.replace(new RegExp('`' + oldName + '`', 'g'), '`' + newName + '`'); let requires = property.requires || []; for (let i = 0; i < requires.length; i++) { if (requires[i] === oldName) { @@ -45,8 +47,8 @@ _.forOwn(cocoaConventions, function (properties, kind) { } } }; - _.forOwn(spec[kind.replace(/^layout_/, 'paint_')], updateRequirements); - _.forOwn(spec[kind.replace(/^paint_/, 'layout_')], updateRequirements); + _.forOwn(spec[kind.replace(/^layout_/, 'paint_')], renameCrossReferences); + _.forOwn(spec[kind.replace(/^paint_/, 'layout_')], renameCrossReferences); }) }); diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index 709b567c982..f7a889ea656 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -42,7 +42,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleScaleAlignment) { }; /** - Controls the frame of reference for `circleTranslate`. + Controls the frame of reference for `circleTranslation`. Values of this type are used in the `MGLCircleStyleLayer.circleTranslationAnchor` property. @@ -489,7 +489,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *circleTranslate __attribute__((unavailable("Use circleTranslation instead."))); /** - Controls the frame of reference for `circleTranslate`. + Controls the frame of reference for `circleTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLCircleTranslationAnchorMap`. Set this property diff --git a/platform/darwin/src/MGLFillExtrusionStyleLayer.h b/platform/darwin/src/MGLFillExtrusionStyleLayer.h index c19a710abe6..f41ad957686 100644 --- a/platform/darwin/src/MGLFillExtrusionStyleLayer.h +++ b/platform/darwin/src/MGLFillExtrusionStyleLayer.h @@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN /** - Controls the frame of reference for `fillExtrusionTranslate`. + Controls the frame of reference for `fillExtrusionTranslation`. Values of this type are used in the `MGLFillExtrusionStyleLayer.fillExtrusionTranslationAnchor` property. @@ -313,7 +313,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *fillExtrusionTranslate __attribute__((unavailable("Use fillExtrusionTranslation instead."))); /** - Controls the frame of reference for `fillExtrusionTranslate`. + Controls the frame of reference for `fillExtrusionTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLFillExtrusionTranslationAnchorMap`. Set this diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index df901225bd0..9d2a7d45fec 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN /** - Controls the frame of reference for `fillTranslate`. + Controls the frame of reference for `fillTranslation`. Values of this type are used in the `MGLFillStyleLayer.fillTranslationAnchor` property. @@ -322,7 +322,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *fillTranslate __attribute__((unavailable("Use fillTranslation instead."))); /** - Controls the frame of reference for `fillTranslate`. + Controls the frame of reference for `fillTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLFillTranslationAnchorMap`. Set this property to diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 0b5122968d1..1547d9d1720 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -58,7 +58,7 @@ typedef NS_ENUM(NSUInteger, MGLLineJoin) { }; /** - Controls the frame of reference for `lineTranslate`. + Controls the frame of reference for `lineTranslation`. Values of this type are used in the `MGLLineStyleLayer.lineTranslationAnchor` property. @@ -515,7 +515,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *lineTranslate __attribute__((unavailable("Use lineTranslation instead."))); /** - Controls the frame of reference for `lineTranslate`. + Controls the frame of reference for `lineTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLLineTranslationAnchorMap`. Set this property to diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index 0a84097f433..c16d7f0c9c6 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -281,7 +281,7 @@ typedef NS_ENUM(NSUInteger, MGLTextTransform) { }; /** - Controls the frame of reference for `iconTranslate`. + Controls the frame of reference for `iconTranslation`. Values of this type are used in the `MGLSymbolStyleLayer.iconTranslationAnchor` property. @@ -298,7 +298,7 @@ typedef NS_ENUM(NSUInteger, MGLIconTranslationAnchor) { }; /** - Controls the frame of reference for `textTranslate`. + Controls the frame of reference for `textTranslation`. Values of this type are used in the `MGLSymbolStyleLayer.textTranslationAnchor` property. @@ -445,8 +445,8 @@ MGL_EXPORT /** Name of image in sprite to use for drawing an image background. A string with `{tokens}` replaced, referencing the data property to pull from. (`{token}` - replacement is only supported for literal `iconImage` values; not for property - functions.) + replacement is only supported for literal `iconImageName` values; not for + property functions.) This attribute corresponds to the icon-image @@ -656,8 +656,8 @@ MGL_EXPORT /** Scales the original size of the icon by the provided factor. The new point size - of the image will be the original point size multiplied by `iconSize`. 1 is the - original size; 3 triples the size of the image. + of the image will be the original point size multiplied by `iconScale`. 1 is + the original size; 3 triples the size of the image. This property is measured in factor of the original icon sizes. @@ -947,7 +947,7 @@ MGL_EXPORT /** Value to use for a text label. Feature properties are specified using tokens like `{field_name}`. (`{token}` replacement is only supported for literal - `textField` values; not for property functions.) + `text` values; not for property functions.) The default value of this property is an `MGLStyleValue` object containing the empty string. Set this property to `nil` to reset it to the default value. @@ -1736,7 +1736,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *iconTranslate __attribute__((unavailable("Use iconTranslation instead."))); /** - Controls the frame of reference for `iconTranslate`. + Controls the frame of reference for `iconTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLIconTranslationAnchorMap`. Set this property to @@ -2061,7 +2061,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *textTranslate __attribute__((unavailable("Use textTranslation instead."))); /** - Controls the frame of reference for `textTranslate`. + Controls the frame of reference for `textTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextTranslationAnchorMap`. Set this property to