Implemented special CommentSaver helper for not loosing comments when doing code transformation

This commit is contained in:
Valentin Kipyatkov
2015-05-23 19:24:55 +03:00
parent 333445d93e
commit b39e9ebdb2
3 changed files with 220 additions and 1 deletions
@@ -38,7 +38,7 @@ import java.io.PrintWriter
import java.io.StringWriter
public fun JetPsiFactory(project: Project?): JetPsiFactory = JetPsiFactory(project!!)
public fun JetPsiFactory(elementForProject: JetElement): JetPsiFactory = JetPsiFactory(elementForProject.getProject())
public fun JetPsiFactory(elementForProject: PsiElement): JetPsiFactory = JetPsiFactory(elementForProject.getProject())
public var JetFile.doNotAnalyze: String? by UserDataProperty(Key.create("DO_NOT_ANALYZE"))
public var JetFile.analysisContext: PsiElement? by UserDataProperty(Key.create("ANALYSIS_CONTEXT"))
@@ -53,6 +53,8 @@ public data class PsiChildRange(public val first: PsiElement?, public val last:
companion object {
public val EMPTY: PsiChildRange = PsiChildRange(null, null)
public fun singleElement(element: PsiElement): PsiChildRange = PsiChildRange(element, element)
}
}