-
Notifications
You must be signed in to change notification settings - Fork 647
extras: add full file name along with base file name #1804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,11 +177,14 @@ static void addCommonPseudoTags (void) | |
| extern void makeFileTag (const char *const fileName) | ||
| { | ||
| tagEntryInfo tag; | ||
| const char *base; | ||
| unsigned long endLine = 0; | ||
|
|
||
| if (!isXtagEnabled(XTAG_FILE_NAMES)) | ||
| return; | ||
|
|
||
| initTagEntry (&tag, baseFilename (fileName), KIND_FILE_INDEX); | ||
| base = baseFilename (fileName); | ||
| initTagEntry (&tag, base, KIND_FILE_INDEX); | ||
|
|
||
| tag.isFileEntry = true; | ||
| tag.lineNumberEntry = true; | ||
|
|
@@ -195,10 +198,23 @@ extern void makeFileTag (const char *const fileName) | |
| unnecessary read line loop. */ | ||
| while (readLineFromInputFile () != NULL) | ||
| ; /* Do nothing */ | ||
| tag.extensionFields.endLine = getInputLineNumber (); | ||
| endLine = getInputLineNumber (); | ||
| } | ||
|
|
||
| tag.extensionFields.endLine = endLine; | ||
| makeTagEntry (&tag); | ||
|
|
||
| /* add the full filename too */ | ||
| if (base != fileName) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The condition will be (if you follow my idea): |
||
| initTagEntry (&tag, fileName, KIND_FILE_INDEX); | ||
| tag.isFileEntry = true; | ||
| tag.lineNumberEntry = true; | ||
| markTagExtraBit (&tag, XTAG_FILE_NAMES); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| tag.lineNumber = 1; | ||
| if (isFieldEnabled (FIELD_END_LINE)) | ||
| tag.extensionFields.endLine = endLine; | ||
| makeTagEntry (&tag); | ||
| } | ||
| } | ||
|
|
||
| static void updateSortedFlag ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -715,10 +715,10 @@ are not listed here. They are experimental or debugging purpose. | |
| Equivalent to ``--file-scope``. | ||
|
|
||
| f/inputFile | ||
| Include an entry for the base file name of every source file | ||
| (e.g. "example.c"), which addresses the first line of the file. | ||
| If ``end:`` field is enabled, the end line number of the file | ||
| can be attached to the tag. | ||
| Include entries for the base and full file names of every source | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the original document as is. |
||
| file (e.g. "example.c" and "src/example.c"), which addresses the | ||
| first line of the file. If ``end:`` field is enabled, the end | ||
| line number of the file can be attached to the tag. | ||
|
|
||
| p/pseudo | ||
| Include pseudo tags. Enabled by default unless the tag file is | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to emit full filename only when --extras=+q is given.
So the comment will be :