Skip to content

fix: cleanup multiline DemoSource#158

Merged
paodb merged 1 commit intomasterfrom
fix-85
Apr 30, 2026
Merged

fix: cleanup multiline DemoSource#158
paodb merged 1 commit intomasterfrom
fix-85

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

@javier-godoy javier-godoy commented Apr 30, 2026

Close #85

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of code demo blocks to ensure proper display and filtering.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Walkthrough

The cleanupCode function in code-viewer.ts is updated to remove complete multiline @DemoSource blocks using parenthesis-aware preprocessing, replacing the previous per-line filtering approach.

Changes

Cohort / File(s) Summary
Code cleanup logic enhancement
base/src/main/resources/META-INF/resources/frontend/code-viewer.ts
Updated cleanupCode to preprocess multiline @DemoSource(...) blocks by nulling lines while tracking parenthesis balance, then removed the explicit @DemoSource exclusion from the final filter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: cleanup multiline DemoSource' clearly and concisely describes the main change: implementing proper handling for multiline @DemoSource annotations in the cleanupCode function.
Linked Issues check ✅ Passed The code changes directly address issue #85 by implementing parenthesis-aware block removal for multiline @DemoSource constructs, ensuring all lines of the annotation are properly removed instead of just the first line.
Out of Scope Changes check ✅ Passed All changes are scoped to the cleanupCode function in code-viewer.ts and directly address the multiline @DemoSource handling objective from issue #85, with no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 fix-85

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@base/src/main/resources/META-INF/resources/frontend/code-viewer.ts`:
- Around line 328-335: The `@DemoSource` removal code only looks for '(' on the
same line; instead compute a parenthesis balance for the annotation start (count
'(' minus ')' on the current line) and if balance > 0 iterate forward updating
balance with counts of '(' and ')' on each subsequent line, setting each visited
lines[k] = null until balance <= 0 or end of file; if balance == 0 just null the
single line. Update the block that inspects lines[i] (the `@DemoSource` handling
loop using variables lines and i) to use this parenthesis-balance loop so
wrapped annotations spanning multiple lines are fully removed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1969207e-ef04-4ea2-b823-ad672ab7e6ce

📥 Commits

Reviewing files that changed from the base of the PR and between fcf590d and 68a1f00.

📒 Files selected for processing (1)
  • base/src/main/resources/META-INF/resources/frontend/code-viewer.ts

Comment thread base/src/main/resources/META-INF/resources/frontend/code-viewer.ts
@javier-godoy javier-godoy marked this pull request as ready for review April 30, 2026 16:13
@paodb paodb merged commit 9515ad3 into master Apr 30, 2026
3 checks passed
@paodb paodb deleted the fix-85 branch April 30, 2026 17:26
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

Cleanup multiline @DemoSource

2 participants