-
Notifications
You must be signed in to change notification settings - Fork 629
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
[RFC] readtags: supports multiple tag files #4068
Draft
masatake
wants to merge
6
commits into
universal-ctags:master
Choose a base branch
from
masatake:readtags-multi-inputs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
Codecov ReportAttention: 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. |
Signed-off-by: Masatake YAMATO <[email protected]>
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 <[email protected]>
…putSpec Signed-off-by: Masatake YAMATO <[email protected]>
… the canonWorkArea Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
$ ~/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 <[email protected]>
masatake
force-pushed
the
readtags-multi-inputs
branch
from
September 12, 2024 21:58
3e67a0f
to
953f035
Compare
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_INCLUDE
directive. 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.