Yggdroot / LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.
Apache License 2.0
2.14k stars 180 forks source link

[Feature request] support goto definition and find reference providing by LSP #475

Open xaljer opened 4 years ago

xaljer commented 4 years ago

Describe your question, feature request, or bug.

operations provided by Leaderf gtags are very common for viewing source code, and sometimes LSP is also good choice which can provide those information. But, using LSP in other plugin, we can not get consistent experience of Leaderf. Would you like to support LSP in Leaderf? or can get information like reference from other LSP plugin? If does, leaderf can query from two sources (gtags and LSP) and show the other one when one getting nothing. For goto definition, can Leaderf gtags return a number of definition now? which can co-work with other LSP plugin under a single key binding. (i found gtags can't goto member definition of a struct).

Steps to reproduce

Actual behaviour

Expected behaviour

xaljer commented 4 years ago

I found a method to combine goto definition of coc.nvim and Leaderf together:

function! s:GoToImplementation()
  if CocAction('jumpImplementation')
    return v:true
  endif
  if CocAction('jumpDefinition')
    return v:true
  endif
  execute(printf("Leaderf! gtags --auto-jump -d %s", expand("<cword>")))
endfunction
Leandros commented 2 years ago

👍