Skip to main content

How to install Solargraph with Sublime Text LSP

1 min read

Solargraph is a Ruby Language Server. It's meant to add code completion and inline documentation onto IDEs.

We have to install the gem first

gem install solargraph

Within Sublime Text Control Panel (CTRL+Shift+P) :

  1. Find Package Control: Install Package
  2. Then LSP
  3. Hit enter

By default, the ST plugin will look for rvm, not rbenv. We have to force the settings Preferences > Package Settings > LSP > Settings, and paste this :

https://gist.github.com/cedricbousmanne/099bccef4472912aba61545d0c31d5ec

Note : you need to adjust the value of the path on line 8. You can find the exact installation path of solargraph on your system with the following command

which solargraph

Finally we can enable the server via the Sublime Text Control Panel (CTRL+Shift+P)

6W7tjXLl.png

How to install Rubocop for Sublime Text with rbenv

1 min read

Rubocop is a static code analyzer and formatter for Ruby. Long story short : it helps you to write better code.

Installing it pretty straight-forward :

gem install rubocop

Within Sublime Text Control Panel (CTRL+Shift+P) :

  1. Find Package Control: Install Package
  2. Then Rubocop (currently v2018.12.05.18.01.20)
  3. Hit enter

By default, the ST plugin will look for rvm, not rbenv. We have to force the settings Preferences > Package Settings > Rubocop > Settings - Users, and paste this :

https://gist.github.com/cedricbousmanne/2c89bf83de175f6fa6fe8dea9b7724b7

Now we can have a list of the available options by typing rubocop withing the Control Panel (CTRL+Shift+P).

RVV9n3B.png