-
Notifications
You must be signed in to change notification settings - Fork 645
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?
Conversation
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
|
You have opened and closed pull requests repeatedly. I wonder what happened to you. BTW, I recommend you to make a topic branch for hacking ctags instead of committing to your master branch. See https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows for more details. |
|
Sorry, it took a while to understand the self-tests kicked off by the pull request and get them to run locally (the simple-glide one still doesn't run). I'm more familiar with using git send-email to send patches rather than pushing to github. |
|
Oh, I see. |
masatake
left a comment
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.
Instead of changing the output of --extras=+f, I would like you to extend the output of --extras=+qf.
So the extended function aligns with the other functions of ctags.
In that case, you don't have to update the expected output of test cases. Instead, you have to add a simple test case verifying --extras=+qf output. Tmain the place to put your test case.
| tag.extensionFields.endLine = endLine; | ||
| makeTagEntry (&tag); | ||
|
|
||
| /* add the full filename too */ |
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 :
/* add the full filename too if --extras=+q is given. */
| makeTagEntry (&tag); | ||
|
|
||
| /* add the full filename too */ | ||
| if (base != fileName) { |
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.
The condition will be (if you follow my idea):
if (base != fileName && isXtagEnabled (XTAG_QUALIFIED_TAGS))
| initTagEntry (&tag, fileName, KIND_FILE_INDEX); | ||
| tag.isFileEntry = true; | ||
| tag.lineNumberEntry = true; | ||
| markTagExtraBit (&tag, XTAG_FILE_NAMES); |
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.
markTagExtraBit (&tag, XTAG_QUALIFIED_TAGS);
| (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 |
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.
Keep the original document as is.
Instead, could you add "If --extras=+q is given, ..." ?
|
Another idea I had was to add all partial paths, e.g., a/b/c/main.c, b/c/main.c, and c/main.c (along with main.c). Thoughts?
---
Robert Elliott, HPE Persistent Memory
________________________________
From: Masatake YAMATO <[email protected]>
Sent: Saturday, July 21, 2018 3:17 AM
To: universal-ctags/ctags
Cc: Elliott, Robert (Persistent Memory); Author
Subject: Re: [universal-ctags/ctags] extras: add full file name along with base file name (#1804)
@masatake requested changes on this pull request.
Instead of changing the output of --extras=+f, I would like you to extend the output of --extras=+qf.
So the extended function aligns with the other functions of ctags.
In that case, you don't have to update the expected output of test cases. Instead, you have to add a simple test case verifying --extras=+qf output. Tmain the place to put your test case.
________________________________
In main/entry.c<#1804 (comment)>:
makeTagEntry (&tag);
+
+ /* add the full filename too */
I think it is better to emit full filename only when --extras=+q is given.
So the comment will be :
/* add the full filename too if --extras=+q is given. */
________________________________
In main/entry.c<#1804 (comment)>:
makeTagEntry (&tag);
+
+ /* add the full filename too */
+ if (base != fileName) {
The condition will be (if you follow my idea):
if (base != fileName && isXtagEnabled (XTAG_QUALIFIED_TAGS))
________________________________
In main/entry.c<#1804 (comment)>:
makeTagEntry (&tag);
+
+ /* add the full filename too */
+ if (base != fileName) {
+ initTagEntry (&tag, fileName, KIND_FILE_INDEX);
+ tag.isFileEntry = true;
+ tag.lineNumberEntry = true;
+ markTagExtraBit (&tag, XTAG_FILE_NAMES);
markTagExtraBit (&tag, XTAG_QUALIFIED_TAGS);
________________________________
In man/ctags.1.rst.in<#1804 (comment)>:
@@ -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
Keep the original comment as is.
Instead, could you add "If --extras=+q is given, ..." ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1804 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ADeVJQ7DSanxZMkGGr_bXFNKLtmUd7Goks5uIuOYgaJpZM4VZUnt>.
|
I feel adding all partial paths to the output when See xtagDefinitions in main/xtag.c and xtagType in main/xtag.h. |
|
@masatake this PR seems like a blocker for 6.1: https://github.com/universal-ctags/ctags/milestone/8 Shall it be rescheduled for 6.2? :) |
|
@catap I agree with you. |
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