-
Notifications
You must be signed in to change notification settings - Fork 686
Escape /* and */ in KDocs #6805
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
base: main
Are you sure you want to change the base?
Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: d1507cf53614e1453e559ce4 |
...lo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/codegen/kotlin/helpers/KDoc.kt
Show resolved
Hide resolved
| .replace("/*", "/*") | ||
| .replace("*/", "*/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means code blocks containing /* will probably not be rendered correctly, right? It's better than code not compiling I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No actually I checked, and that's rendered correctly in the IDE and in the generated KDoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this string:
```
*
```
Is rendered as this codeblock:
/*
Then how does one displays * in a codeblock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this?
/**
* generates some foo!
* example:
*
* ```kotlin
* /* this is how you do it! */
* val foo = doFoo()
* ```
*/
fun doFoo() = TODO()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine by me, especially if the current state is to generate non-compiling code but probably means the "good" fix needs to be in Kotlin somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I've just opened https://youtrack.jetbrains.com/issue/KT-83005/


Workaround square/kotlinpoet#887