From 2e1b8c72fb7c071bedffbe7176799b1e373eb2f4 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Fri, 20 Jul 2018 10:46:28 -0500 Subject: [PATCH] extras: add full file name along with base file name For --extras=+f, add the full file name along with the base file name. For example, this allows using vim's -t argument: vim -t main/entry.c rather than requiring the -t be dropped: vim main/entry.c --- Tmain/extras-long.d/stdout-expected.txt | 10 +++++----- Tmain/list-extras.d/stdout-expected.txt | 4 ++-- Units/extra-total-lines.d/expected.tags | 1 + .../disabling-m4.d/expected.tags | 1 + .../expected.tags | 1 + .../simple2.ac.d/expected.tags | 1 + .../disabling-autoconf.d/expected.tags | 1 + .../disabling-subparser.d/expected.tags | 1 + Units/parser-m4.r/m4-comment.d/expected.tags | 1 + .../m4-multi-undef.d/expected.tags | 1 + .../m4-switch-lang-by-ac.d/expected.tags | 1 + .../m4-switch-lang-by-m4.d/expected.tags | 1 + .../python-end-field.d/expected.tags | 1 + .../parser-python.r/simple.py.d/expected.tags | 1 + Units/parser-yacc.r/nested.d/expected.tags | 1 + Units/simple-glade.d/expected.tags | 1 + main/entry.c | 20 +++++++++++++++++-- main/xtag.c | 2 +- man/ctags.1.rst.in | 8 ++++---- 19 files changed, 44 insertions(+), 14 deletions(-) diff --git a/Tmain/extras-long.d/stdout-expected.txt b/Tmain/extras-long.d/stdout-expected.txt index 39c3ccd24b..53c7b222f8 100644 --- a/Tmain/extras-long.d/stdout-expected.txt +++ b/Tmain/extras-long.d/stdout-expected.txt @@ -2,7 +2,7 @@ - anonymous no NONE no Include tags for non-named objects like lambda - subword no NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope no NONE no Include tags of file scope -f inputFile no NONE no Include an entry for the base file name of every input file +f inputFile no NONE no Include an entry for the base and full file names of every input file g guest no NONE no Include tags generated by guest parsers p pseudo no NONE no Include pseudo tags q qualified no NONE no Include an extra class-qualified tag entry for each tag @@ -14,7 +14,7 @@ s subparser yes NONE no Include tags generated by subpa - anonymous yes NONE no Include tags for non-named objects like lambda - subword no NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope yes NONE no Include tags of file scope -f inputFile no NONE no Include an entry for the base file name of every input file +f inputFile no NONE no Include an entry for the base and full file names of every input file g guest no NONE no Include tags generated by guest parsers p pseudo yes NONE no Include pseudo tags q qualified no NONE no Include an extra class-qualified tag entry for each tag @@ -26,7 +26,7 @@ s subparser yes NONE no Include tags generated by subpa - anonymous yes NONE no Include tags for non-named objects like lambda - subword no NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope no NONE no Include tags of file scope -f inputFile no NONE no Include an entry for the base file name of every input file +f inputFile no NONE no Include an entry for the base and full file names of every input file g guest no NONE no Include tags generated by guest parsers p pseudo yes NONE no Include pseudo tags q qualified no NONE no Include an extra class-qualified tag entry for each tag @@ -38,7 +38,7 @@ s subparser yes NONE no Include tags generated by subpa - anonymous yes NONE no Include tags for non-named objects like lambda - subword no NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope no NONE no Include tags of file scope -f inputFile yes NONE no Include an entry for the base file name of every input file +f inputFile yes NONE no Include an entry for the base and full file names of every input file g guest no NONE no Include tags generated by guest parsers p pseudo yes NONE no Include pseudo tags q qualified no NONE no Include an extra class-qualified tag entry for each tag @@ -50,7 +50,7 @@ s subparser yes NONE no Include tags generated by subpa - anonymous yes NONE no Include tags for non-named objects like lambda - subword no NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope no NONE no Include tags of file scope -f inputFile no NONE no Include an entry for the base file name of every input file +f inputFile no NONE no Include an entry for the base and full file names of every input file g guest no NONE no Include tags generated by guest parsers p pseudo yes NONE no Include pseudo tags q qualified yes NONE no Include an extra class-qualified tag entry for each tag diff --git a/Tmain/list-extras.d/stdout-expected.txt b/Tmain/list-extras.d/stdout-expected.txt index 87e53e04a8..d8e650648e 100644 --- a/Tmain/list-extras.d/stdout-expected.txt +++ b/Tmain/list-extras.d/stdout-expected.txt @@ -2,7 +2,7 @@ - anonymous yes NONE no Include tags for non-named objects like lambda - subword yes NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope yes NONE no Include tags of file scope -f inputFile yes NONE no Include an entry for the base file name of every input file +f inputFile yes NONE no Include an entry for the base and full file names of every input file g guest yes NONE no Include tags generated by guest parsers p pseudo yes NONE no Include pseudo tags q qualified yes NONE no Include an extra class-qualified tag entry for each tag @@ -14,7 +14,7 @@ s subparser yes NONE no Include tags generated by subpa - anonymous yes NONE no Include tags for non-named objects like lambda - subword yes NONE no Include tags for subwords generated by splitting the original tag (only for ctags development) F fileScope yes NONE no Include tags of file scope -f inputFile yes NONE no Include an entry for the base file name of every input file +f inputFile yes NONE no Include an entry for the base and full file names of every input file g guest yes NONE no Include tags generated by guest parsers p pseudo yes NONE no Include pseudo tags q qualified yes NONE no Include an extra class-qualified tag entry for each tag diff --git a/Units/extra-total-lines.d/expected.tags b/Units/extra-total-lines.d/expected.tags index 98139be270..fa8f25489b 100644 --- a/Units/extra-total-lines.d/expected.tags +++ b/Units/extra-total-lines.d/expected.tags @@ -1,2 +1,3 @@ +./Units/extra-total-lines.d/input.c input.c 1;" F end:6 input.c input.c 1;" F end:6 main input.c 2;" f typeref:typename:int end:5 diff --git a/Units/parser-autoconf.r/disabling-m4.d/expected.tags b/Units/parser-autoconf.r/disabling-m4.d/expected.tags index 714ae5c5fd..fb35a8d3dc 100644 --- a/Units/parser-autoconf.r/disabling-m4.d/expected.tags +++ b/Units/parser-autoconf.r/disabling-m4.d/expected.tags @@ -1,2 +1,3 @@ PKG_PREREQ input.ac /^AC_DEFUN([PKG_PREREQ],$/;" m line:4 language:Autoconf roles:def end:8 input.ac input.ac 1;" F line:1 language:Autoconf roles:def end:12 +./Units/parser-autoconf.r/disabling-m4.d/input.ac input.ac 1;" F line:1 language:Autoconf roles:def end:12 diff --git a/Units/parser-autoconf.r/forcing-autoconf-and-disabling-m4.d/expected.tags b/Units/parser-autoconf.r/forcing-autoconf-and-disabling-m4.d/expected.tags index 5cf11ec09a..eb1873b5a4 100644 --- a/Units/parser-autoconf.r/forcing-autoconf-and-disabling-m4.d/expected.tags +++ b/Units/parser-autoconf.r/forcing-autoconf-and-disabling-m4.d/expected.tags @@ -1,2 +1,3 @@ PKG_PREREQ input.m4 /^AC_DEFUN([PKG_PREREQ],$/;" m line:4 language:Autoconf roles:def end:8 input.m4 input.m4 1;" F line:1 language:Autoconf roles:def end:12 +./Units/parser-autoconf.r/forcing-autoconf-and-disabling-m4.d/input.m4 input.m4 1;" F line:1 language:Autoconf roles:def end:12 diff --git a/Units/parser-autoconf.r/simple2.ac.d/expected.tags b/Units/parser-autoconf.r/simple2.ac.d/expected.tags index aa2d699001..5143b3d89d 100644 --- a/Units/parser-autoconf.r/simple2.ac.d/expected.tags +++ b/Units/parser-autoconf.r/simple2.ac.d/expected.tags @@ -3,3 +3,4 @@ PKG_PREREQ input.ac /^AC_DEFUN([PKG_PREREQ],$/;" m line:4 language:Autoconf role y input.ac /^m4_define([y], 2)$/;" d line:9 language:M4 roles:def end:9 z input.ac /^define(`z', 3)$/;" d line:11 language:M4 roles:def end:11 input.ac input.ac 1;" F line:1 language:Autoconf roles:def end:12 +./Units/parser-autoconf.r/simple2.ac.d/input.ac input.ac 1;" F line:1 language:Autoconf roles:def end:12 diff --git a/Units/parser-m4.r/disabling-autoconf.d/expected.tags b/Units/parser-m4.r/disabling-autoconf.d/expected.tags index 71d95fac97..acc1d449a4 100644 --- a/Units/parser-m4.r/disabling-autoconf.d/expected.tags +++ b/Units/parser-m4.r/disabling-autoconf.d/expected.tags @@ -3,3 +3,4 @@ x input.m4 /^define(`x', 1)$/;" d line:1 language:M4 roles:def end:1 [y] input.m4 /^m4_define([y], 2)$/;" d line:7 language:M4 roles:def end:7 z input.m4 /^define(`z', 3)$/;" d line:9 language:M4 roles:def end:9 input.m4 input.m4 1;" F line:1 language:M4 roles:def end:10 +./Units/parser-m4.r/disabling-autoconf.d/input.m4 input.m4 1;" F line:1 language:M4 roles:def end:10 diff --git a/Units/parser-m4.r/disabling-subparser.d/expected.tags b/Units/parser-m4.r/disabling-subparser.d/expected.tags index 71d95fac97..3d48086c71 100644 --- a/Units/parser-m4.r/disabling-subparser.d/expected.tags +++ b/Units/parser-m4.r/disabling-subparser.d/expected.tags @@ -3,3 +3,4 @@ x input.m4 /^define(`x', 1)$/;" d line:1 language:M4 roles:def end:1 [y] input.m4 /^m4_define([y], 2)$/;" d line:7 language:M4 roles:def end:7 z input.m4 /^define(`z', 3)$/;" d line:9 language:M4 roles:def end:9 input.m4 input.m4 1;" F line:1 language:M4 roles:def end:10 +./Units/parser-m4.r/disabling-subparser.d/input.m4 input.m4 1;" F line:1 language:M4 roles:def end:10 diff --git a/Units/parser-m4.r/m4-comment.d/expected.tags b/Units/parser-m4.r/m4-comment.d/expected.tags index d44fe52306..6cff5c881c 100644 --- a/Units/parser-m4.r/m4-comment.d/expected.tags +++ b/Units/parser-m4.r/m4-comment.d/expected.tags @@ -1,2 +1,3 @@ CAPTUREME input.m4 /^- define(CAPTUREME,val0)$/;" d line:1 language:M4 end:1 input.m4 input.m4 1;" F line:1 language:M4 end:3 +./Units/parser-m4.r/m4-comment.d/input.m4 input.m4 1;" F line:1 language:M4 end:3 diff --git a/Units/parser-m4.r/m4-multi-undef.d/expected.tags b/Units/parser-m4.r/m4-multi-undef.d/expected.tags index ea88ce181d..985003f955 100644 --- a/Units/parser-m4.r/m4-multi-undef.d/expected.tags +++ b/Units/parser-m4.r/m4-multi-undef.d/expected.tags @@ -2,3 +2,4 @@ a input.m4 /^undefine(a,b,c)$/;" d line:1 language:M4 roles:undef b input.m4 /^undefine(a,b,c)$/;" d line:1 language:M4 roles:undef c input.m4 /^undefine(a,b,c)$/;" d line:1 language:M4 roles:undef input.m4 input.m4 1;" F line:1 language:M4 roles:def end:1 +./Units/parser-m4.r/m4-multi-undef.d/input.m4 input.m4 1;" F line:1 language:M4 roles:def end:1 diff --git a/Units/parser-m4.r/m4-switch-lang-by-ac.d/expected.tags b/Units/parser-m4.r/m4-switch-lang-by-ac.d/expected.tags index 984b226fc2..d5dd374365 100644 --- a/Units/parser-m4.r/m4-switch-lang-by-ac.d/expected.tags +++ b/Units/parser-m4.r/m4-switch-lang-by-ac.d/expected.tags @@ -3,3 +3,4 @@ PKG_PREREQ input.m4 /^AC_DEFUN([PKG_PREREQ],$/;" m line:2 language:Autoconf role y input.m4 /^m4_define([y], 2)$/;" d line:7 language:M4 roles:def end:7 z input.m4 /^define(`z', 3)$/;" d line:9 language:M4 roles:def end:9 input.m4 input.m4 1;" F line:1 language:Autoconf roles:def end:10 +./Units/parser-m4.r/m4-switch-lang-by-ac.d/input.m4 input.m4 1;" F line:1 language:Autoconf roles:def end:10 diff --git a/Units/parser-m4.r/m4-switch-lang-by-m4.d/expected.tags b/Units/parser-m4.r/m4-switch-lang-by-m4.d/expected.tags index e69c8329f2..4fa6ebfa7a 100644 --- a/Units/parser-m4.r/m4-switch-lang-by-m4.d/expected.tags +++ b/Units/parser-m4.r/m4-switch-lang-by-m4.d/expected.tags @@ -1,3 +1,4 @@ y input.m4 /^m4_define([y], 2)$/;" d line:1 language:M4 roles:def end:1 z input.m4 /^define(`z', 3)$/;" d line:3 language:M4 roles:def end:3 input.m4 input.m4 1;" F line:1 language:Autoconf roles:def end:3 +./Units/parser-m4.r/m4-switch-lang-by-m4.d/input.m4 input.m4 1;" F line:1 language:Autoconf roles:def end:3 diff --git a/Units/parser-python.r/python-end-field.d/expected.tags b/Units/parser-python.r/python-end-field.d/expected.tags index 24ab5a2717..64a4de5e6d 100644 --- a/Units/parser-python.r/python-end-field.d/expected.tags +++ b/Units/parser-python.r/python-end-field.d/expected.tags @@ -10,3 +10,4 @@ A.h input.py /^ def h(self):$/;" m line:12 class:A end:14 i input.py /^ def i(self):$/;" m line:16 class:A end:18 A.i input.py /^ def i(self):$/;" m line:16 class:A end:18 input.py input.py 1;" F line:1 end:18 +./Units/parser-python.r/python-end-field.d/input.py input.py 1;" F line:1 end:18 diff --git a/Units/parser-python.r/simple.py.d/expected.tags b/Units/parser-python.r/simple.py.d/expected.tags index d7e3530691..277eb0acd0 100644 --- a/Units/parser-python.r/simple.py.d/expected.tags +++ b/Units/parser-python.r/simple.py.d/expected.tags @@ -43,3 +43,4 @@ two.only input.py /^ def only(arg):$/;" kind:member line:48 language:Python s three input.py /^three\\$/;" kind:class line:52 language:Python inherits:A, B, C access:public roles:def end:54 foo input.py /^foo($/;" kind:function line:57 language:Python access:public signature:( x , y, z) roles:def end:60 input.py input.py 1;" kind:file line:1 language:Python roles:def extras:inputFile end:60 +./Units/parser-python.r/simple.py.d/input.py input.py 1;" kind:file line:1 language:Python roles:def extras:inputFile end:60 diff --git a/Units/parser-yacc.r/nested.d/expected.tags b/Units/parser-yacc.r/nested.d/expected.tags index e30b445653..a62192105a 100644 --- a/Units/parser-yacc.r/nested.d/expected.tags +++ b/Units/parser-yacc.r/nested.d/expected.tags @@ -22,3 +22,4 @@ yyerror input.y /^yyerror(char *s)$/;" f language:C typeref:typename:int extras: yywrap input.y /^yywrap(void)$/;" f language:C typeref:typename:int extras:guest CFGParseFile input.y /^CFGParseFile(FILE *file)$/;" f language:C typeref:typename:int extras:guest input.y input.y 1;" F language:YACC extras:inputFile +./Units/parser-yacc.r/nested.d/input.y input.y 1;" F language:YACC extras:inputFile diff --git a/Units/simple-glade.d/expected.tags b/Units/simple-glade.d/expected.tags index f62f1b61df..83083531ca 100644 --- a/Units/simple-glade.d/expected.tags +++ b/Units/simple-glade.d/expected.tags @@ -5,3 +5,4 @@ GtkWindow input.glade /^$/;" class line:6 GtkButton input.glade /^ $/;" class line:23 roles:widget on_button1_clicked input.glade /^