Skip to content

Avoid errors for empty DSL matches in add-on mode#2675

Open
zeeshankhan-05 wants to merge 2 commits into
Shopify:mainfrom
zeeshankhan-05:fix-issue-2348
Open

Avoid errors for empty DSL matches in add-on mode#2675
zeeshankhan-05 wants to merge 2 commits into
Shopify:mainfrom
zeeshankhan-05:fix-issue-2348

Conversation

@zeeshankhan-05

@zeeshankhan-05 zeeshankhan-05 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Return early when the add-on finds no processable DSL for a constant
  • Avoid logging a Tapioca::Error in the editor
  • Keep the normal CLI error behavior unchanged

Fixes #2348

Test plan

  • Added an add-on test using an existing Foo class with no processable DSL
  • Confirmed the test fails without the fix and passes with it
  • Confirmed the CLI empty-match tests still pass

When the LSP requests generation for an existing constant with no
processable DSL, return quietly instead of raising Tapioca::Error.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zeeshankhan-05
zeeshankhan-05 requested a review from a team as a code owner July 17, 2026 19:01
Comment thread spec/tapioca/addon_spec.rb Outdated
end)
break if Process.clock_gettime(Process::CLOCK_MONOTONIC) >= deadline

sleep(0.1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is guaranteed to be flakey if the GitHub action runner is overcommited. Is there some other wait we could do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right. I'll replace the timed poll with a wait on the dsl request's work-done-progress "end" event. So since the error log is always sent before "end", then blocking until "end" makes the check deterministic. I'll enable window.workDoneProgress on the test client

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now waiting on the dsl work-done-progress "end" event instead of a timed poll. Errors are always logged before "end", so the check is deterministic.

Copy link
Copy Markdown
Contributor

Good improvement though!

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Trying to generate DSLs with add-on for a non-processable constant errors

2 participants