scala-ide/scala-search — pull request #45 by mads379 (2013-05-25 14:55:38+00:00)
Title: Fix for overloaded method symbols

When asking for the type of a position that contains an invocation of
an overloaded method we would sometimes get an overloaded method
symbol from the compiler rather than the symbol of the precise method
that was being invoked.

The problem is that `askTypeAt` only returns the smallest fully attributed
tree that encloses a given position. Consider the following example

def askOption[A](op: () => A): Option[A] = askOption(op, 10000)
def askOption[A](op: () => A, timeout: Int): Option[A] = None

askOption { () =>
...
}

If the position is at the beginning of the `askOption` identifier (the invocation)
then the presentation compiler will only type-check the receiver (the Select node)
and not the arguments and thus will not resolve the overloaded method.

We fix this by asking the compiler to type-check more of the tree using a
RangePosition.

Fixes #38