[GH-ISSUE #83] Refactor: (usize, usize) -> Position, start_position: Position and end_position: Position -> Span #150

Closed
opened 2026-03-15 11:47:36 +03:00 by kerem · 2 comments
Owner

Originally created by @mschlaipfer on GitHub (Dec 17, 2025).
Original GitHub issue: https://github.com/awslabs/iam-policy-autopilot/issues/83

Originally assigned to: @mschlaipfer on GitHub.

We have multiple occurrences of usize pairs, and structs which have both a start_position and an end_position with .0 and .1 calls. We should clean these up to make the code more readable. We currently modify the 0-indexed positions provided by TreeSitter in various places throughout the code base. It would be nicer if we stored them as-is, and have a 1-indexed view on the Position struct (and if we need it a 0-indexed one).

Originally created by @mschlaipfer on GitHub (Dec 17, 2025). Original GitHub issue: https://github.com/awslabs/iam-policy-autopilot/issues/83 Originally assigned to: @mschlaipfer on GitHub. We have multiple occurrences of `usize` pairs, and structs which have both a `start_position` and an `end_position` with `.0` and `.1` calls. We should clean these up to make the code more readable. We currently modify the 0-indexed positions provided by TreeSitter in various places throughout the code base. It would be nicer if we stored them as-is, and have a 1-indexed view on the `Position` struct (and if we need it a 0-indexed one).
kerem 2026-03-15 11:47:36 +03:00
Author
Owner

@mschlaipfer commented on GitHub (Dec 18, 2025):

This should happen after https://github.com/awslabs/iam-policy-autopilot/pull/84 is merged

<!-- gh-comment-id:3669003852 --> @mschlaipfer commented on GitHub (Dec 18, 2025): This should happen after https://github.com/awslabs/iam-policy-autopilot/pull/84 is merged
Author
Owner

@mschlaipfer commented on GitHub (Jan 13, 2026):

https://github.com/awslabs/iam-policy-autopilot/pull/84 introduces a struct Location which accomplishes this.

<!-- gh-comment-id:3745321339 --> @mschlaipfer commented on GitHub (Jan 13, 2026): https://github.com/awslabs/iam-policy-autopilot/pull/84 introduces a `struct Location` which accomplishes this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/iam-policy-autopilot#150
No description provided.