Skip to content

LSP: Custom DSL Extensions not loading #2238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cquinones100 opened this issue Mar 19, 2025 · 0 comments
Open

LSP: Custom DSL Extensions not loading #2238

cquinones100 opened this issue Mar 19, 2025 · 0 comments

Comments

@cquinones100
Copy link
Contributor

I originally reported this on the ruby-dx slack.

I am using the tapioca add on for the ruby lsp in an application that has several custom dsl extensions. I am seeing errors on lsp reruns of tapioca that indicate to me that extensions are not loading, or the constants they are patching are being overwritten downstream.

I'm able to repro in this minimal rails app.

For reference, the error I am seeing in that app is

2025-03-12 09:29:12.089 [info] (ruby-lsp-extension-repro) Request dsl failed:
/Users/carlos.quinones/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-8.0.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `__tapioca_test_method_calls' for User:Class (NoMethodError)
Did you mean?  __tapioca_stored_attributes
	from /Users/carlos.quinones/ruby-lsp-extension-repro/sorbet/tapioca/compilers/test_compiler.rb:18:in `decorate'

Indicating that the attr_reader defined in the extension is not defined on the constant when the associated compiler is run.

Other details:
Ruby LSP version 0.9.9
ruby-lsp gem version 0.23.12

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

No branches or pull requests

1 participant