Support analyzing multiple argument indices in FindArgumentsCommand#15
Merged
johnsonlee merged 1 commit intomainfrom Jan 30, 2026
Merged
Support analyzing multiple argument indices in FindArgumentsCommand#15johnsonlee merged 1 commit intomainfrom
johnsonlee merged 1 commit intomainfrom
Conversation
Add `argumentIndices` to `ArgumentConstantQuery` DSL and update the `find-args` CLI command to accept comma-separated argument indices via `-i 0,1,2`. Results are grouped by argument index when multiple indices are analyzed. Backward compatible: existing `argumentIndex = 0` DSL usage and single `-i 0` CLI usage work unchanged. https://claude.ai/code/session_01JtVeJugK5K7Nio4cMzTaWQ
55df9a8 to
4477b39
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.
Summary
Enhanced the argument constant analysis feature to support tracking multiple argument indices simultaneously, rather than being limited to a single argument per query.
Key Changes
CLI Option Enhancement: Changed
-i/--arg-indexoption from accepting a single integer to accepting comma-separated indices (e.g.,0,1,2)argIndex: InttoargIndices: List<Int>with default valuelistOf(0)split = ","to picocli option for automatic parsingQuery DSL Updates: Extended
ArgumentConstantQueryclass to support multiple indicesargumentIndices: List<Int>?property alongside existingargumentIndex: Int?resolveIndices()method with priority logic: explicitargumentIndices>argumentIndex> defaultlistOf(0)Output Formatting: Improved text output to handle multiple arguments
argumentIndexfield to JSON output for each occurrenceDocumentation: Added example in QueryDsl showing how to track multiple arguments
Implementation Details
The change maintains backward compatibility through the
resolveIndices()method, which allows users to specify arguments either via the newargumentIndiceslist or the legacyargumentIndexsingle value. The formatting logic intelligently adjusts output structure based on whether one or multiple indices are being analyzed, keeping single-argument queries concise while providing clear organization for multi-argument analysis.