Skip to content

refactor: improve repr of account interp#134

Merged
ascandone merged 1 commit into
mainfrom
refactor/improve-interp-ast-repr
May 13, 2026
Merged

refactor: improve repr of account interp#134
ascandone merged 1 commit into
mainfrom
refactor/improve-interp-ast-repr

Conversation

@ascandone
Copy link
Copy Markdown
Contributor

Improve the representation of interpolated accounts, e.g. @user:$id:pending, so that we also keep the ":" parts in the AST.
This doesn't change the existing behaviour, nor the way it interacts with LSP (e.g. mouse hovering). But it keeps a more correct and lossless AST

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a95579b-fa37-4378-872f-55e90833c60f

📥 Commits

Reviewing files that changed from the base of the PR and between 5c66ad9 and 18c3475.

⛔ Files ignored due to path filters (1)
  • internal/parser/__snapshots__/parser_test.snap is excluded by !**/*.snap, !**/*.snap
📒 Files selected for processing (3)
  • internal/interpreter/evaluate_expr.go
  • internal/parser/ast.go
  • internal/parser/parser.go

Walkthrough

Account interpolation literals are refactored to capture colon separators as explicit text parts during parsing, then concatenate all parts without delimiters in both the AST string representation and runtime evaluation.

Changes

Account interpolation literal refactor

Layer / File(s) Summary
Account interpolation parsing, representation, and evaluation
internal/parser/parser.go, internal/parser/ast.go, internal/interpreter/evaluate_expr.go
Parser iteration now captures TerminalNode colon tokens as explicit AccountTextPart entries. AST String() and evaluator AccountInterpLiteral handling both change from colon-joined to empty-string-joined concatenation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A colon's tale retold with care,
The parser splits it everywhere,
No join-string, just parts plain—
Account names flow, refactored clean! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: improve repr of account interp' directly relates to the main change: improving the representation of interpolated accounts in the AST by preserving colon separators.
Description check ✅ Passed The description is closely related to the changeset, explaining how the changes preserve ':' parts in the AST for interpolated accounts while maintaining existing behavior.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/improve-interp-ast-repr

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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

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

@ascandone ascandone requested a review from Azorlogh May 13, 2026 12:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.56%. Comparing base (5c66ad9) to head (18c3475).

Files with missing lines Patch % Lines
internal/parser/ast.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
+ Coverage   68.50%   68.56%   +0.06%     
==========================================
  Files          46       46              
  Lines        4648     5590     +942     
==========================================
+ Hits         3184     3833     +649     
- Misses       1290     1584     +294     
+ Partials      174      173       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ascandone ascandone merged commit 2175505 into main May 13, 2026
7 checks passed
@ascandone ascandone deleted the refactor/improve-interp-ast-repr branch May 13, 2026 13:06
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