Skip to content

Commit

Permalink
Update ktfmt component on FBS:master
Browse files Browse the repository at this point in the history
Reviewed By: strulovich

Differential Revision: D36123426

fbshipit-source-id: 32cb667623564a38def123d20b88179bffe20cdb
  • Loading branch information
cgrushko authored and facebook-github-bot committed May 8, 2022
1 parent 63eef56 commit bd2e5c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ class KotlinInputAstVisitor(
lastIndexToOpen = index
}
}
is KtArrayAccessExpression, is KtPostfixExpression -> {
is KtArrayAccessExpression,
is KtPostfixExpression -> {
// we group these with the last item with a name, and we always close them
groupingInfos[lastIndexToOpen].groupOpenCount++
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ object TypeNameClassifier {
TYPE(true) {
override fun next(n: JavaCaseFormat): TyParseState {
return when (n) {
JavaCaseFormat.UPPERCASE, JavaCaseFormat.LOWER_CAMEL, JavaCaseFormat.LOWERCASE ->
FIRST_STATIC_MEMBER
JavaCaseFormat.UPPERCASE,
JavaCaseFormat.LOWER_CAMEL,
JavaCaseFormat.LOWERCASE -> FIRST_STATIC_MEMBER
JavaCaseFormat.UPPER_CAMEL -> TYPE
}
}
Expand All @@ -73,7 +74,8 @@ object TypeNameClassifier {
override fun next(n: JavaCaseFormat): TyParseState {
return when (n) {
JavaCaseFormat.UPPERCASE -> AMBIGUOUS
JavaCaseFormat.LOWER_CAMEL, JavaCaseFormat.LOWERCASE -> REJECT
JavaCaseFormat.LOWER_CAMEL,
JavaCaseFormat.LOWERCASE -> REJECT
JavaCaseFormat.UPPER_CAMEL -> TYPE
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/com/facebook/ktfmt/kdoc/KDocFormatter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ object KDocFormatter {
KDocTokens.LEADING_ASTERISK -> Unit // Ignore, no need to output anything
KDocTokens.TAG_NAME -> tokens.add(KDocToken(TAG, tokenText))
KDocTokens.CODE_BLOCK_TEXT -> tokens.add(KDocToken(CODE, tokenText))
KDocTokens.MARKDOWN_INLINE_LINK, KDocTokens.MARKDOWN_LINK -> {
KDocTokens.MARKDOWN_INLINE_LINK,
KDocTokens.MARKDOWN_LINK -> {
tokens.add(KDocToken(MARKDOWN_LINK, tokenText))
}
KDocTokens.TEXT -> {
Expand Down

0 comments on commit bd2e5c7

Please sign in to comment.