1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: support ctags with -print_v_files and .ctags.d/v.ctags

This commit is contained in:
Delyan Angelov
2020-04-30 19:15:30 +03:00
parent 250dea7bd1
commit a6dfc6d46b
7 changed files with 71 additions and 2 deletions

View File

@ -89,6 +89,18 @@ The build flags are shared by the build and run commands:
-v, -vv, -vvv
Enable varying verbosity in the V compiler while compiling
-print_v_files
Just print the list of all parsed .v files, then stop processing further.
This is useful for running external processing tools:
./v -print_v_files cmd/v | etags -L -
... will generate a TAGS file, that emacs can then use to jump
to the definition of functions used by v itself. For vim:
./v -print_v_files cmd/v | ctags -L -
... will generate a simillar tags file, that vi compatible editors can use.
NB: an useful, although not entirely accurate regexp based Universal Ctags options file
for V is located in `.ctags.d/v.ctags` . If you use https://ctags.io/ , it will be used
up automatically, or you can specify it explicitly with --options=.ctags.d/v.ctags .
For C-specific build flags, use `v help build-c`.
See also:

View File

@ -174,6 +174,9 @@ fn parse_args(args []string) (&pref.Preferences, string) {
'-x64' {
res.backend = .x64
}
'-print_v_files' {
res.print_v_files = true
}
'-os' {
target_os := cmdline.option(current_args, '-os', '')
i++