Skip to content

Commit

Permalink
Add outdated version info to troubleshooting guide [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed May 16, 2024
1 parent 4c19061 commit 6339750
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,36 @@ ruby-lsp
Is there any extra information given from booting the server manually? Or does it only fail when booting through the
extension?

### Outdated Version

In some circumstances, the version of Ruby LSP activated may be outdated.

*Why This Happens*

Since v0.12.0, Ruby LSP has had dependency on the [Prism](https://rubygems.org/gems/prism) parser.
Prior to that, it had a dependency on a different parser, [YARP](https://rubygems.org/gems/yarp).
Since Prism is a pre-1.0 release, there may be breaking changes introduced in minor version increases.
For that reason, we constrain the version of Prism up to that which is known to be compatible.

With the custom bundle approach describe earlier, we need to use a version of `ruby-lsp` which is compatible the dependencies already in your `Gemfile.lock.`

When a new version of Prism is released, it will take some time for the Ruby LSP maintainer to verify the compatibility, and make any necessary updates.

During that time, it's possible for Prism version in your `Gemfile.lock` to be increased due it being a dependency of another gem in your app.

If the Prism constraint cannot be satisfied, Bundler may resolve `ruby-lsp` to a much older version, which uses YARP.

*How To Solve It*

You can add a dependency constraint to your Gemfile limiting the Prism version to that maximum supported by Ruby LSP.
For example:

```
gem "prism", "< 0.28" # example for Ruby LSP v0.16.6
```

Once Prism becomes sufficiently stable, we will relax the version constraint to alleviate this problem.

## After troubleshooting

If after troubleshooting the Ruby LSP is still not initializing properly, please report an issue
Expand Down

0 comments on commit 6339750

Please sign in to comment.