Bash-Support: function calls references
Hi, getting a list of function calls, with possibility to jump to any, would be extremely useful. I didn't find any software capable of doing this. Is it even exists, and can we implement it if not? I tried GLOBAL, but it's Pygments parser fetches variable references but not calls.
Thanks for Bash-Support!
@WolfgangMehner @FritzMehner
So you mean a taglist? One which would have the position of function definitions, and then also the lines where these functions are called.
Sorry I don't know exactly what is taglist.
ctags "resolves" a tag from it's occurrence to the place where it defined, but not otherwise.
So how could we get all the function calls given it's definition?
I don't know any method, except :vimgrep (kinda of "brute-force search"). But it's not quite that.
cscope and Global allow it, but not for shell scripts (see OP)
Here is BashLexer used by GLOBAL's Pygments parser: https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/lexers/shell.py Only if we could force it to pick up all simple commands..
Here is my workaround for now:
:exe "vimgrep /[^#]*".expand("<cword>")."[^(']/ ##"
use it while standing on function definition.
## arglist should be populated beforehand with needed file names, for example - all open buffers, with command :bufdo :args ## %, or replaced with wildcarded path: **/*.sh
As you can see, it's pretty ugly, so proper solution still needed.