-
Notifications
You must be signed in to change notification settings - Fork 27
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
Enum values with underscores sometimes don't convert to native cross references #1542
Comments
The problem might be related to the library https://github.com/vsch/flexmark-java which is used in this project. Currently gluecodium is using 0.64.0 tag of that project. I've tried 0.64.8, which is the latest available. The result is the same. I've added the following diff to print out some information during comment processing diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/common/CommentsProcessor.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/common/CommentsProcessor.kt
index 3ea6624d5..520a3aa7a 100644
--- a/gluecodium/src/main/java/com/here/gluecodium/generator/common/CommentsProcessor.kt
+++ b/gluecodium/src/main/java/com/here/gluecodium/generator/common/CommentsProcessor.kt
@@ -59,12 +59,16 @@ abstract class CommentsProcessor(
): String {
val document = parser.parse(comment.trim())
val path = limeFullName.split(".")
-
+ println("======== Begin process")
+ println(comment.trim())
val linkRefHandler = VisitHandler(LinkRef::class.java) {
+ println( "Inside LinkRefHandler" )
+
if (it.isDefined) return@VisitHandler
val rawReference = it.reference.toString()
val normalizedReference = normalizeReference(rawReference)
+ println( normalizedReference.toString() )
for (i in path.size downTo 0) {
val child = (path.take(i) + normalizedReference).joinToString(".")
val element = limeToLanguage[child]
@@ -85,6 +89,7 @@ abstract class CommentsProcessor(
NodeVisitor(linkRefHandler, codeBlockHandler, autoLinkHandler).visit(document)
val renderedDocument = renderer.render(document)
+ println("====== End process\n")
return postRenderDocument(renderedDocument).trim()
} When I run ./generate -input ../functional-tests/functional/input/lime/CommentsWithCrossReferenceOfEnumValue.lime -generators dart -output test I've got the following result for method comments of the test class.
One can notice for the 3 bad cases for INVALID_PARAMETER, the LinkRefHandler is not getting called at all. |
The ticket would be left open until we get a fix from vsch/flexmark-java project. Then we can update the dependent version in the build.gradle file of this project. |
When enum values with underscores in their names are used in comments as cross references, they are not converted correctly as native cross references. I've constructed a test case CommentsWithCrossReferenceOfEnumValue.lime.
After building the gluecodium project, run the following command in the project root folder:
One can also use the absolute path for the input lime file.
Check the generated files
TestClassEnumValueWithUnderScore.h sometimes doesn't work. For example:
instead of the correct one
TestClassEnumValueWithoutUnderScore.h always working.
test_class_enum_value_with_under_score.dart sometimes doesn't work. For example
instead of the correct one
test_class_enum_value_without_under_score.dart always working.
TestClassEnumValueWithUnderScore.swift sometimes doesn't work.TestClassEnumValueWithoutUnderScore.swift always working.
The text was updated successfully, but these errors were encountered: