Skip to content

chore(frontend): drop rewriteDeclaredTypeName, now unused - #1126

Merged
JoaoGSP merged 1 commit into
developmentfrom
chore/drop-unused-rewrite-declared-type-name
Sep 18, 2026
Merged

JoaoGSP merged 1 commit into
developmentfrom
chore/drop-unused-rewrite-declared-type-name

Conversation

@JoaoGSP

@JoaoGSP JoaoGSP commented Sep 18, 2026

Copy link
Copy Markdown
Member

Follow-up to DOPE-622, from Julio's review (finding 2).

That change rewrote restoreBufferName to serialise the canonical text instead of preserving the user's typed form, which removed rewriteDeclaredTypeName's last production caller. Only its own test suite imported it afterwards.

Removed:

  • rewriteDeclaredTypeName in utils/PLC/data-type-text-parser.ts
  • its describe block — 7 tests
  • declaredNameRegex, which existed solely for that helper

No behaviour change: nothing in the app called it.

Validation

Check web editor
tsc --noEmit exit 0 exit 0
data-type-text-parser suite 23 / 23
utils/PLC suites 46 suites, 851 tests
full suite + coverage exit 0, thresholds met
prettier / eslint clean
compare-surfaces.py match — 1125 files, 0 diffs

Coverage totals moved by exactly the removed code: statements 20904 → 20887, functions 4236 → 4234.

No Jira card — non-ticket maintenance, which is what chore/ is for.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jjy1Ja62BFtay579KYhBC7

Mirror of https://github.com/Autonomy-Logic/openplc-web/pull/769

Summary by CodeRabbit

  • Bug Fixes
    • Removed support for rewriting declared data type names from text content.
    • Retained existing data type parsing, validation, and expected-name matching behavior.

DOPE-622 rewrote `restoreBufferName` to serialise the canonical text
instead of preserving the typed form, which removed this helper's last
production caller. Only its own suite imported it. `declaredNameRegex`
went with it — the helper was its only user.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jjy1Ja62BFtay579KYhBC7
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2009ba1d-d7db-4e2f-ba38-060adb264c59

📥 Commits

Reviewing files that changed from the base of the PR and between a526744 and 0c918a0.

📒 Files selected for processing (2)
  • src/frontend/utils/PLC/__tests__/data-type-text-parser.test.ts
  • src/frontend/utils/PLC/data-type-text-parser.ts
💤 Files with no reviewable changes (1)
  • src/frontend/utils/PLC/data-type-text-parser.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The parser removes rewriteDeclaredTypeName and its regex. Its test suite removes the helper import and five related tests. parseDataTypeFromText behavior remains unchanged.

Changes

Parser helper removal

Layer / File(s) Summary
Remove declared name rewriting
src/frontend/utils/PLC/data-type-text-parser.ts, src/frontend/utils/PLC/__tests__/data-type-text-parser.test.ts
The parser removes declaredNameRegex and rewriteDeclaredTypeName. The tests remove the helper import and its dedicated coverage.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 0c918

No actionable current-head risk is established; the change is limited to removing unused code and its tests.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely states the main change: removal of the unused rewriteDeclaredTypeName helper.
Description check ✅ Passed The description explains the reason for the change, lists the removed entities, states that behavior is unchanged, and records extensive validation results. It does not reproduce the DOD checklist, bu…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit finds the rewrite trail gone
The parser keeps parsing on
Old tests hop away
New checks guard the day
The type names rest till dawn

Comment @coderabbitai help to get the list of available commands.

@JoaoGSP
JoaoGSP merged commit da1e2bc into development Sep 18, 2026
12 checks passed
@JoaoGSP
JoaoGSP deleted the chore/drop-unused-rewrite-declared-type-name branch September 18, 2026 14:19
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