[RFC] readtags: supports multiple tag files#4068
Draft
masatake wants to merge 6 commits intouniversal-ctags:masterfrom
Draft
[RFC] readtags: supports multiple tag files#4068masatake wants to merge 6 commits intouniversal-ctags:masterfrom
masatake wants to merge 6 commits intouniversal-ctags:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4068 +/- ##
==========================================
+ Coverage 85.51% 85.53% +0.02%
==========================================
Files 237 237
Lines 57030 57030
==========================================
+ Hits 48769 48782 +13
+ Misses 8261 8248 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
The original code called findTag or listTags directly in the process of command line parsing. This change introduces new data structure named actionSpec. During parsing command line, readtags builds an actionSpec. After parsing readtags takes an action based on the actionSpec. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…putSpec Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… the canonWorkArea Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
$ ~/bin/ctags -o podman.tags -R ~/var/podman $ ~/bin/ctags -o glibc.tags -R ~/var/glibc $ ~/bin/ctags -o coreutils832.tags -R /srv/sources9c/sources/c/coreutils/8.32-31.el9--srpm/pre-build/coreutils-8.32 $ ./readtags -A -Q '(and (eq? $name "main") (#/.*user.*/ $input))' -t podman.tags -t glibc.tags -t coreutils832.tags -l main /srv/sources9c/sources/c/coreutils/8.32-31.el9--srpm/pre-build/coreutils-8.32/gnulib-tests/test-userspec.c /^main (void)$/ main /srv/sources9c/sources/c/coreutils/8.32-31.el9--srpm/pre-build/coreutils-8.32/lib/getusershell.c /^main (void)$/ main /srv/sources9c/sources/c/coreutils/8.32-31.el9--srpm/pre-build/coreutils-8.32/lib/userspec.c /^main (int argc, char **argv)$/ main /srv/sources9c/sources/c/coreutils/8.32-31.el9--srpm/pre-build/coreutils-8.32/src/users.c /^main (int argc, char **argv)$/ $ ./readtags -A -Q '(and (eq? $name "main") (#/.*container.*/ $input))' -t podman.tags -t glibc.tags -t coreutils832.tags -l main /home/yamato/var/glibc/support/echo-container.c /^main (int argc, const char **argv)$/ main /home/yamato/var/glibc/support/shell-container.c /^main (int argc, const char **argv)$/ main /home/yamato/var/glibc/support/test-container.c /^main (int argc, char **argv)$/ main /home/yamato/var/glibc/support/true-container.c /^main (void)$/ $ ./readtags -A -Q '(not (#/.*_test.*/ $input))' -t podman.tags -t glibc.tags -t coreutils832.tags rootless rootless /home/yamato/var/podman/pkg/rootless/rootless.go /^package rootless$/ rootless /home/yamato/var/podman/pkg/rootless/rootless_freebsd.go /^package rootless$/ rootless /home/yamato/var/podman/pkg/rootless/rootless_linux.go /^package rootless$/ rootless /home/yamato/var/podman/pkg/rootless/rootless_unsupported.go /^package rootless$/ rootless /home/yamato/var/podman/vendor/github.com/containers/image/v5/internal/rootless/rootless.go /^package rootless$/ Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3e67a0f to
953f035
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements the ideas I wrote in universal-ctags/citre#178.
Example sessions:
With this pull request, readtags can take multiple -t option. So you can find a tag in multiple files at once. Using multiple threads is future work.
This pull request adds
!_READTAGS_INCLUDEdirective. If a tag file is specified with the pseudo tag, readtags reads the tas file, too, as if the tag file is specified with -t on the command line.This pull request adds -X/--generate-aggregate-tag-file option to readtags. With the option, readtags generate an aggregate tag file enumerating all tag files specified with -t on the command line.