Skip to content

docs: document positions.rs, RefactorArgs::position, and request_building.rs position-to-byte-offset conversion in developers-guide #134

Description

@coderabbitai

Summary

PR #126 introduced crates/weaverd/src/dispatch/act/refactor/positions.rs, a position: Option<String> field on RefactorArgs, and substantial position-to-offset conversion logic in request_building.rs. None of this internal architecture is documented in docs/developers-guide.md.

Work Required

Add a section to docs/developers-guide.md covering:

  • positions.rs module — purpose, public-facing parse_line_col and line_col_to_byte_offset functions, Unicode-awareness, CRLF handling, and the one-indexed column convention.
  • arguments.rs position field — the new --position LINE:COL flag on RefactorArgs, its validation path through parse_position_flag, and the builder lifecycle.
  • request_building.rs capability argument mapping — the CapabilityMappingContext struct, how apply_capability_argument_mapping dispatches by CapabilityId, and the apply_rename_symbol_mapping logic that converts CLI --position (or deprecated offset=) into a plugin-internal byte offset.

Background

Raised as an out-of-scope documentation follow-up from PR #126.
Requested by @leynos.

Backlink: #126

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions