Allow specifying the target class/object by the offset to the definition

This is necessary for the "Add method" quickfix when the compiler tells us "not found: value <method name>", since we don't know from the error message whether the attempt to invoke that method is in a class or an object.