Vim-go: add support for GoDef call instead of go guru

Created on 6 Jun 2016  路  2Comments  路  Source: fatih/vim-go

Actual behavior

Go Guru is used for "GoDef" or "gd" to jump to definition by default.

Expected behavior

Have config parameter to use "godef", which is faster in most circumstances.

Steps to reproduce:

open a go project
put cursor on a function
type ":GoDef"
wait for go guru to do its thing....

Let me know if you need any more info!
Running both in parallel and getting the fastest result would also be awesome!
a variant like GoDefGuru for using one or the other would also be awesomer!

Most helpful comment

I always prefer simple and well known solutions, so there will be no such parallel calling. Beside that currently Vim doesn't have a way to call things in parallel, even with vim 8.0 with it's async jobs, I think it's not worth to implement concurrent callings of the same problem just to gain milliseconds, because vim itself is already single threaded.

The feature is now merged to master. You can now use

let g:go_def_mode = 'godef'

To switch to godef. By default we still use guru as it covers more edge cases and I prefer stability over performance. Thanks for the feedback!

All 2 comments

Is running both in parallel the best alternative?. Or maybe just allow to switch between one and the other one?

I always prefer simple and well known solutions, so there will be no such parallel calling. Beside that currently Vim doesn't have a way to call things in parallel, even with vim 8.0 with it's async jobs, I think it's not worth to implement concurrent callings of the same problem just to gain milliseconds, because vim itself is already single threaded.

The feature is now merged to master. You can now use

let g:go_def_mode = 'godef'

To switch to godef. By default we still use guru as it covers more edge cases and I prefer stability over performance. Thanks for the feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnzeng picture johnzeng  路  3Comments

derekchiang picture derekchiang  路  3Comments

andrejvanderzee picture andrejvanderzee  路  3Comments

cassiobotaro picture cassiobotaro  路  3Comments

groob picture groob  路  3Comments