Skip to content

Internal: 4 call sites in Paragraph.swift still use deprecated paragraph.commentIds (post-#6 cleanup) #18

Description

@kiki830621

Current Status

Phase: implemented
Last updated: 2026-05-02
Implementation: PR #35 / commit e63baaa
Verification: swift build; focused swift test --filter InsertLocationTests|ParagraphTests|Issue56RoundtripCompletenessTests|Issue6RoundtripLoudFailTests; full swift test (830 tests, 1 skipped, 0 failures)

Notes: Public Paragraph.commentIds remains as the deprecated compatibility API, while internal emit and comment mutation paths now use non-deprecated backing storage/mutators. swift build no longer reports source warnings for commentIds.

Problem

After #6 (v0.21.4) deprecated Run.commentIds and Paragraph.commentIds, 4 internal sites in Sources/OOXMLSwift/Models/Paragraph.swift still read from the deprecated property, producing build warnings:

Paragraph.swift:
  ⚠ [Line 409:26] 'commentIds' is deprecated
  ⚠ [Line 446:26] 'commentIds' is deprecated
  ⚠ [Line 546:26] 'commentIds' is deprecated
  ⚠ [Line 730:26] 'commentIds' is deprecated

These are internal consumers of the property, not external API users — the deprecation warning IS firing on our own code.

Type

tech-debt / cleanup

Severity

LOW (good first issue) — pure migration, ~4 sites, follows the same pattern documented in the deprecation message:

Use commentRangeMarkers (source of truth since Phase 4) or the computed commentRangeIds. Stored commentIds is no longer populated by Reader since v0.21.4 and will be removed in v0.22.

Expected

Replace each paragraph.commentIds read with either:

  • paragraph.commentRangeIds (computed from commentRangeMarkers) — preferred drop-in replacement
  • paragraph.commentRangeMarkers.compactMap { ... } — if richer marker info is needed

After migration, build should be deprecation-free for commentIds. Public surface unchanged (deprecated setters still work for downstream callers until v0.22 removal).

Why surface this now

These warnings became visible after #6 shipped (v0.21.4); the LSP diagnostic refresh during #15 docs work made them obvious. Fixing them is a prerequisite for the v0.22 milestone (where commentIds storage gets removed entirely — internal sites would fail to compile).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions