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

Fix illegal chars getting generated into function names. #234

Merged
merged 2 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sample/src/main/java/com/airbnb/android/showkasesample/Text.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,14 @@ fun H6TextRowComponentPreview(
) {
H6TextRowComponent(person.name)
}

// This is here for testing, generating this code into function names would
// fail dex generation
@Preview(name = "H6 Text Row & special chars !@#$%^&*()_+", group = "Text")
@Composable
fun H6TextRowComponentPreviewWithSpecialCharInPreview(
age: String = "15",
@PreviewParameter(provider = ParameterProvider::class) person: Person
) {
H6TextRowComponent(person.name)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name1(): Unit {
public fun group1name1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -32,7 +32,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group2_name2(): Unit {
public fun group2name2(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -46,7 +46,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseKDoc = "",
showkaseMetadataType = "COLOR"
)
public fun color_name(): Unit {
public fun colorname(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -60,6 +60,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseKDoc = "",
showkaseMetadataType = "TYPOGRAPHY"
)
public fun typography_name(): Unit {
public fun typographyname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable1(): Unit {
public fun WrapperClassTestComposable1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -37,6 +37,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
previewParameterClass = [ParameterProvider::class],
previewParameterName = "text"
)
public fun Default_Group_TestComposable2(): Unit {
public fun DefaultGroupTestComposable2(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR"
)
public fun WrapperClass_name(): Unit {
public fun WrapperClassname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [ShowkaseObject::class],
showkaseMetadataType = "COLOR"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [Composables::class],
showkaseMetadataType = "COLOR"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
previewParameterClass = [NewParameterProvider::class],
previewParameterName = "bankHeader"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group2_name2(): Unit {
public fun group2name2(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable(): Unit {
public fun WrapperClassTestComposable(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable(): Unit {
public fun WrapperClassTestComposable(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable(): Unit {
public fun WrapperClassTestComposable(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable(): Unit {
public fun WrapperClassTestComposable(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable(): Unit {
public fun WrapperClassTestComposable(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun WrapperClass_TestComposable(): Unit {
public fun WrapperClassTestComposable(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name1(): Unit {
public fun group1name1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -32,6 +32,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name2(): Unit {
public fun group1name2(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name1(): Unit {
public fun group1name1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -32,6 +32,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name2(): Unit {
public fun group1name2(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name1(): Unit {
public fun group1name1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -32,6 +32,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false
)
public fun group1_name2(): Unit {
public fun group1name2(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
previewParameterClass = [ParameterProvider::class],
previewParameterName = "text"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR"
)
public fun WrapperClass_Red(): Unit {
public fun WrapperClassRed(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "TYPOGRAPHY"
)
public fun WrapperClass_Title(): Unit {
public fun WrapperClassTitle(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR"
)
public fun WrapperClass_Red(): Unit {
public fun WrapperClassRed(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "TYPOGRAPHY"
)
public fun WrapperClass_Title(): Unit {
public fun WrapperClassTitle(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "TYPOGRAPHY"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [ShowkaseObject::class],
showkaseMetadataType = "TYPOGRAPHY"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "TYPOGRAPHY"
)
public fun group_name(): Unit {
public fun groupname(): Unit {
}
}
Loading