[Ctags] Definitions of lua functions inside nested modules
Brought to you by:
dhiebert
|
From: Doron B. <dor...@gm...> - 2018-01-12 15:38:25
|
Hi all, I have a question regarding modulated lua scripts, allow me to
explain:
Let's say I have a lua script called `myscript.lua` and it has a line
like this:
local foo = require('foo')
Inside `foo/`, I have the file `init.lua` which is loaded by the
interpreter in the line above. In addition, `foo/init.lua` loads by
itself a lot of other files like `foo/bla.lua` and `foo/baz/init.lua`
and `foo/baz/bar.lua`. Thus, functions inside `foo/baz/init.lua` and
`foo/baz/bar.lua` (e.g `baz.example_function()` and
`bar.other_function()`) are being called in `myscript.lua` like this:
foo.baz.example_function()
foo.baz.bar.other_function()
The problem is, that when I run `ctags .` I can see in the generated
`tags` file has entries like:
baz.example_function foo/baz/init.lua /^function baz.example_function()$/;" f
bar.other_function foo/baz/bar.lua /^function bar.other_function()$/;" f
While I edit `myscript.lua` and my cursor is positioned on
`foo.baz.example_function()`, I want to jump to the definition of
`baz.example_function()` which is located in the file
`foo/baz/init.lua`, my text editor is telling me it can't find it.
I understand why it can't find the definition -- because the correct
definition in the `tags` file is for `baz.example_function` -- without
the preceding `foo.`. If I manually add the preceding `foo.` to the
definition I can easily jump to `foo/baz/init.lua`.
**My question is this:** How do I tell `ctags` to write this preceding
`foo.` automatically in the `tags` file?
Help will be much appreciated, thanks.
|