Description
I have checked that this feature is not already implemented
- This feature does not exist
Use case
The LSP currently does not auto-detect Rails for Engine/Railtie projects, presumably as of #2218. The ability to use the Rails add-on when working on such projects would be extremely useful, particularly for tests and feature congruence when working on Rails applications and common dependencies simultaneously.
Description
A few options come to mind:
- The Rails LSP add-on to be automatically installed upon detection of a Railtie-based project, instead of just a concrete application
- Automatic inclusion upon detection of a Rails dummy application
- Manual configuration via VS Code Settings to "tell" Ruby LSP to install the add-on
Implementation
Ideally the auto-detection for Rails apps would be modified to add an additional check - whether or not the main class descends from Rails::Railtie
. Variable-depth namespacing may add complexity to finding the main class, but I'm no expert. Applying the current check a second time at [spec|test]/*/config/application.rb
may be a suitable alternative for basing inclusion on the existence of a dummy app - something included as standard by the Rails plugin generator.
If these options aren't feasible, could some mechanism be added to allow users to manually specify that the Rails add-on should be included?