Part of SCL-5499 {for `class A \n {def f = 1}`} ; SCL-5327 fixed {Worksheet: output of evaluation results stops on selecting or editing code in .sc file}
Tool window is not activated when scala worksheet started
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'
SCL-4935 More robust breakpoint positioning for macro-arguments.

A def macro might splice its arguments directly into the enclosing
callsite, or into a nested class / anon function. If it does the latter,
the position manager produces the wrong breakpoint specification.

This commit uses the "f.q.n.EnclosingClass*" in such cases, which
catches both cases.

I don't think we have test infrastructure for this. My manual test
was to check that all println-s below could be breakpointed.

import scala.reflect.macros.Context
import language.experimental._
object M {
  def impl(c: Context)(a: c.Expr[Any]): c.Expr[Any] = c.universe.reify {
    if ("".isEmpty)
      (() => {
        c.Expr[Any](c.resetAllAttrs(a.tree)).splice
      })()
    else ???
  }
  def apply(a: Any) = macro impl
}

object N {
  def impl(c: Context)(a: c.Expr[Any]): c.Expr[Any] = c.universe.reify {
    if ("".isEmpty)
      c.Expr[Any](c.resetAllAttrs(a.tree)).splice
    else ???
  }
  def apply(a: Any) = macro impl
}

object Lazy {
  def apply(a: =>Any) {a}
}

object Main {
  def main(args: Array[String]) {
    println("here")
    M {
      println("1")
      println("2")
    }
    N {
      println("1")
      println("2")
    }
    Lazy{
      println("1")
      println("2")
    }
    (new T {}).apply
    new C().apply
  }
}

trait T {
  def apply {
    println("here")
    M {
      println("1")
      M apply {
        println("2")
        println("2")
      }
    }
    N {
      println("2")
      N {
        println("1")
        println("1")
      }
    }
    Lazy {
      println("2")
      println("2")
    }
  }
}

class C {
  def apply {
    println("here")
    M {
      println("1")
      M {
        println("2")
      }
    }
    N {
      println("1")
      N {
        println("2")
      }
    }
    Lazy {
      println("2")
      println("xxx")
    }
  }
}
Merge branch 'ticket/SCL-4935' of git://github.com/retronym/intellij-scala into retronym-ticket/SCL-4935
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master'