Fix build.

This commit is contained in:
Zalim Bashorov
2015-04-06 17:29:58 +03:00
parent 1055c34474
commit 79739b7090
5 changed files with 14 additions and 5 deletions
@@ -300,6 +300,8 @@ private fun createKeywordWithLabelElement(keyword: String, label: String?): Look
fun breakOrContinueExpressionItems(position: JetElement, breakOrContinue: String): Collection<LookupElement> { fun breakOrContinueExpressionItems(position: JetElement, breakOrContinue: String): Collection<LookupElement> {
val result = ArrayList<LookupElement>() val result = ArrayList<LookupElement>()
@parentsLoop
for (parent in position.parents()) { for (parent in position.parents()) {
when (parent) { when (parent) {
is JetLoopExpression -> { is JetLoopExpression -> {
@@ -313,7 +315,7 @@ fun breakOrContinueExpressionItems(position: JetElement, breakOrContinue: String
} }
} }
is JetDeclarationWithBody -> break //TODO: support non-local break's&continue's when they are supported by compiler is JetDeclarationWithBody -> break@parentsLoop //TODO: support non-local break's&continue's when they are supported by compiler
} }
} }
return result return result
@@ -56,6 +56,8 @@ public class SyntheticKotlinBlock(
override fun toString(): String { override fun toString(): String {
var child = subBlocks.first() var child = subBlocks.first()
var treeNode: ASTNode? = null var treeNode: ASTNode? = null
@loop
while (treeNode == null) when (child) { while (treeNode == null) when (child) {
is AbstractBlock -> { is AbstractBlock -> {
treeNode = (child as AbstractBlock).getNode() treeNode = (child as AbstractBlock).getNode()
@@ -63,7 +65,7 @@ public class SyntheticKotlinBlock(
is SyntheticKotlinBlock -> { is SyntheticKotlinBlock -> {
child = (child as SyntheticKotlinBlock).getSubBlocks().first() child = (child as SyntheticKotlinBlock).getSubBlocks().first()
} }
else -> break else -> break@loop
} }
val textRange = getTextRange() val textRange = getTextRange()
@@ -506,12 +506,14 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
fun calcNecessaryEmptyLines(decl: JetDeclaration, after: Boolean): Int { fun calcNecessaryEmptyLines(decl: JetDeclaration, after: Boolean): Int {
var lineBreaksPresent: Int = 0 var lineBreaksPresent: Int = 0
var neighbor: PsiElement? = null var neighbor: PsiElement? = null
@siblingsLoop
for (sibling in decl.siblings(forward = after, withItself = false)) { for (sibling in decl.siblings(forward = after, withItself = false)) {
when (sibling) { when (sibling) {
is PsiWhiteSpace -> lineBreaksPresent += (sibling.getText() ?: "").count { it == '\n' } is PsiWhiteSpace -> lineBreaksPresent += (sibling.getText() ?: "").count { it == '\n' }
else -> { else -> {
neighbor = sibling neighbor = sibling
break break@siblingsLoop
} }
} }
} }
@@ -90,6 +90,8 @@ public fun processDuplicates(
if (answer != Messages.YES) return if (answer != Messages.YES) return
var showAll = false var showAll = false
@duplicateReplacersLoop
for ((i, entry) in duplicateReplacers.entrySet().withIndex()) { for ((i, entry) in duplicateReplacers.entrySet().withIndex()) {
val (pattern, replacer) = entry val (pattern, replacer) = entry
if (!pattern.isValid()) continue if (!pattern.isValid()) continue
@@ -101,7 +103,7 @@ public fun processDuplicates(
promptDialog.show() promptDialog.show()
when(promptDialog.getExitCode()) { when(promptDialog.getExitCode()) {
FindManager.PromptResult.ALL -> showAll = true FindManager.PromptResult.ALL -> showAll = true
FindManager.PromptResult.SKIP -> continue FindManager.PromptResult.SKIP -> continue@duplicateReplacersLoop
FindManager.PromptResult.CANCEL -> return FindManager.PromptResult.CANCEL -> return
} }
} }
@@ -34,9 +34,10 @@ object DocCommentConverter {
val html = StringBuilder { val html = StringBuilder {
appendJavadocElements(docComment.getDescriptionElements()) appendJavadocElements(docComment.getDescriptionElements())
@tagsLoop
for (tag in docComment.getTags()) { for (tag in docComment.getTags()) {
when (tag.getName()) { when (tag.getName()) {
"deprecated" -> continue "deprecated" -> continue@tagsLoop
"see" -> append("@see ${convertJavadocLink(tag.content())}\n") "see" -> append("@see ${convertJavadocLink(tag.content())}\n")
else -> appendJavadocElements(tag.getChildren()).append("\n") else -> appendJavadocElements(tag.getChildren()).append("\n")
} }