Skip to content

Fix sorted metadata for unsorted tags - #355

Open
dajiaohuang wants to merge 1 commit into
dalance:masterfrom
dajiaohuang:fix/unsorted-tag-header-20261016
Open

dajiaohuang wants to merge 1 commit into
dalance:masterfrom
dajiaohuang:fix/unsorted-tag-header-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

ptags --unsorted passes --sort=no to the workers, but not to the separate ctags invocation that creates the tag-file header. A source file defining zeta before alpha therefore produces those tags in that order while advertising !_TAG_FILE_SORTED\t1. Consumers use this field to choose sorted-file lookup, so the header must describe the actual output.

Change

Pass the same unsorted setting when generating the header. Keep the default sorted behavior unchanged. Add public run_opt integration coverage using a temporary C source and explicit input list/output/directory, checking both the metadata and tag order.

Validation

  • On the unchanged base, the new unsorted regression fails; default sorted coverage passes.
  • With this change, both tests pass with real Universal Ctags 5.9.0 on Linux and 6.1.0 on Windows: cargo test --locked --test tag_sort -- --test-threads=1.
  • cargo test --locked --no-run, changed-file rustfmt check and git diff --check pass.
  • Full existing runtime tests were not run: they enumerate the checkout and require its repository/LFS/submodule fixtures. Separate synthetic CLI acceptance covered tracked/untracked/ignored selection, exclusions, list/stdin, submodules, LFS, output modes and configuration; this is not a claim that the full upstream suite passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant