Update go to definition feature

Some tests on this feature are failing on Travis CI.
I tried to fix it but we have to wait for results from Travis CI again (I don't have Mac OS for quick testing).