Skip to content

Support analyzing multiple argument indices in FindArgumentsCommand#15

Merged
johnsonlee merged 1 commit intomainfrom
claude/track-method-arguments-wXHpx
Jan 30, 2026
Merged

Support analyzing multiple argument indices in FindArgumentsCommand#15
johnsonlee merged 1 commit intomainfrom
claude/track-method-arguments-wXHpx

Conversation

@johnsonlee
Copy link
Owner

@johnsonlee johnsonlee commented Jan 30, 2026

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-index option from accepting a single integer to accepting comma-separated indices (e.g., 0,1,2)

    • Updated argIndex: Int to argIndices: List<Int> with default value listOf(0)
    • Added split = "," to picocli option for automatic parsing
  • Query DSL Updates: Extended ArgumentConstantQuery class to support multiple indices

    • Added argumentIndices: List<Int>? property alongside existing argumentIndex: Int?
    • Implemented resolveIndices() method with priority logic: explicit argumentIndices > argumentIndex > default listOf(0)
  • Output Formatting: Improved text output to handle multiple arguments

    • Results are now grouped by argument index first, then by constant value
    • Added conditional indentation and labeling when multiple indices are analyzed
    • Updated summary section to show which arguments were analyzed
    • Added argumentIndex field to JSON output for each occurrence
  • Documentation: 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 new argumentIndices list or the legacy argumentIndex single 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.

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
@johnsonlee johnsonlee force-pushed the claude/track-method-arguments-wXHpx branch from 55df9a8 to 4477b39 Compare January 30, 2026 03:48
@johnsonlee johnsonlee merged commit ec56b4f into main Jan 30, 2026
1 check passed
@johnsonlee johnsonlee deleted the claude/track-method-arguments-wXHpx branch January 30, 2026 05:05
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.

2 participants