Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'idea162.x-cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
teamcityserver authored and teamcityserver committed Jul 26, 2016
2 parents 2618457 + ae74fbd commit 42c4ce1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Expand Up @@ -34,15 +34,14 @@ trait ScAnnotationsHolder extends ScalaPsiElement with PsiAnnotationOwner {
case _ => None
}

val maybeStubAnnotations = maybeStub.toSeq flatMap {
_.getChildrenByType(TokenSet.create(ScalaElementTypes.ANNOTATIONS),
JavaArrayFactoryUtil.ScAnnotationsFactory).toSeq
} headOption
val maybeStubAnnotations = maybeStub.toSeq.flatMap({
_.getChildrenByType(TokenSet.create(ScalaElementTypes.ANNOTATIONS),
JavaArrayFactoryUtil.ScAnnotationsFactory).toSeq
}).headOption

val maybeAnnotations = (maybeStubAnnotations ++
Option(findChildByClassScala(classOf[ScAnnotations]))) headOption
val maybeAnnotations = maybeStubAnnotations.orElse(Option(findChildByClassScala(classOf[ScAnnotations])))

maybeAnnotations.toSeq flatMap {
maybeAnnotations.toSeq.flatMap {
_.getAnnotations.toSeq
}
}
Expand Down
Expand Up @@ -55,9 +55,9 @@ class WorksheetFoldingBuilder extends FoldingBuilder {
(node.getText.startsWith(WorksheetFoldingBuilder.FIRST_LINE_PREFIX) ||
node.getText.startsWith(WorksheetFoldingBuilder.LINE_PREFIX))) {
val length = Math.max(WorksheetFoldingBuilder.FIRST_LINE_PREFIX.length, WorksheetFoldingBuilder.LINE_PREFIX.length)
descriptors += (new FoldingDescriptor(node,
descriptors += new FoldingDescriptor(node,
new TextRange(node.getPsi.asInstanceOf[PsiComment].getTextRange.getStartOffset,
node.getPsi.asInstanceOf[PsiComment].getTextRange.getStartOffset + length), null, Collections.emptySet[AnyRef], true))
node.getPsi.asInstanceOf[PsiComment].getTextRange.getStartOffset + length), null, Collections.emptySet[AnyRef], true)
}

for (child <- node.getChildren(null)) {
Expand Down

0 comments on commit 42c4ce1

Please sign in to comment.