solargraph icon indicating copy to clipboard operation
solargraph copied to clipboard

Setup LOAD_PATH from require_paths

Open mkon opened this issue 2 years ago • 0 comments

Hey everyone, thanks for this nice gem, I am trying to incorporate it into more parts of my ruby development.

Sometimes I am using a setup where I do not want to add solargraph to the Gemfile, so I can not start it via bundle exec. However I still want a diagnoser like rubocop to be able to require files of local gems, for example custom cops provided by a local gem (with a path pointer in the local Gemfile).

Currently rubocop will just crash because it can not load those files for custom cop definitions, but with some simple change we can expose the configuration of require_files to rubocop by updating LOAD_PATH. In many cases require_files already has a working default and there is no additional configuration required.

WDYT? @castwide

mkon avatar Apr 11 '23 11:04 mkon