Skip to content

Commit

Permalink
[J2KT] Fix KDoc comments in Renderer.kt to match Kotlin style guideli…
Browse files Browse the repository at this point in the history
…nes.

PiperOrigin-RevId: 586347959
  • Loading branch information
Googler authored and copybara-github committed Nov 29, 2023
1 parent 0c726f6 commit f353ef1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ class KotlinGeneratorStage(private val output: OutputUtils.Output, private val p
)

val renderer =
Renderer(
environment,
problems,
topLevelQualifiedNames = compilationUnit.topLevelQualifiedNamesSet
)
Renderer(environment, topLevelQualifiedNames = compilationUnit.topLevelQualifiedNamesSet)

// Render types, collecting qualified names to import
val typesSource = renderer.typesSource(compilationUnit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,25 @@
*/
package com.google.j2cl.transpiler.backend.kotlin

import com.google.j2cl.common.Problems
import com.google.j2cl.transpiler.ast.Type

/** Renderer of the Kotlin source code. */
/**
* Provides context for rendering Kotlin source code.
*
* @property environment rendering environment
* @property currentReturnLabelIdentifier optional label to render in return statements
* @property currentType currently rendered type, or null if not rendering a type
* @property renderThisReferenceWithLabel whether to render this reference with explicit qualifier
* @property localNames a set of local names which are potentially shadowing imports
* @property topLevelQualifiedNames top-level qualified names, which will be rendered as simple name
* without import
*/
internal data class Renderer(
/** Rendering environment. */
val environment: Environment,

/** Rendering problems. */
val problems: Problems,

/** Label to render with the return statement. */
val currentReturnLabelIdentifier: String? = null,

/** Currently rendered type. */
val currentType: Type? = null,

/** Whether to render this reference with explicit qualifier. */
// TODO(b/252138814): Remove when KT-54349 is fixed
val renderThisReferenceWithLabel: Boolean = false,

/** A set of local names which are potentially shadowing imports. */
val localNames: Set<String> = setOf(),

/** Top-level qualified names, which will be rendered as simple name without import. */
val topLevelQualifiedNames: Set<String> = setOf()
)

0 comments on commit f353ef1

Please sign in to comment.