Ruby on Micro
Ctrl/Cmd-click a Ruby use-case reference such as:
use_case('use_cases.orders.create').execute(payload)
The extension opens:
app/use_cases/orders/create.rb
The same works for blueprints and steps imported through a Ruby configuration import:
include Config::Import['blueprints.invoice_blueprint']
include Config::Import[
publish_created: 'steps.orders.publish_created'
]
These open app/blueprints/invoice_blueprint.rb and
app/steps/orders/publish_created.rb respectively.
Ruby constants are also supported. Ctrl/Cmd-clicking:
Constants::ErrorCodes::AUTH_SIGNATURE_INVALID
opens config/constants/error_codes.rb and jumps to the line where
AUTH_SIGNATURE_INVALID is defined, including constants declared with
define :AUTH_SIGNATURE_INVALID, ....
Run locally
- Open this directory in VS Code.
- Run
npm install.
- Run
npm run compile.
- Press
F5 to launch an Extension Development Host.
- Open the Ruby project you want to work on in that new window.
- Open a Ruby file containing a configured reference.
- Ctrl/Cmd-click the reference.
Configure rubyOnMicro.referenceRoots when a repository stores
its implementation directories somewhere other than app. Configure
rubyOnMicro.constantRoots when constant files are stored somewhere other
than config/constants.