Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add outdated version info to troubleshooting guide #2060

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,37 @@ to index for features such as go to definition.

## Common issues

There are two main sources of issues users typically face during activation: shell or Bundler related problems.
There are three main sources of issues users typically face during activation: outdated version, shell problems, or Bundler related problems.

### Outdated Version

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

**Why this happens**

Since v0.12.0, Ruby LSP has had a dependency on the [Prism](https://rubygems.org/gems/prism) parser.
Prior to that, the Prism parser was named [YARP](https://rubygems.org/gems/yarp). The fact that the gem was renamed leads to some awkward dependency resolutions.
Since Prism is a pre-1.0 release, there may be breaking changes introduced in minor versions.
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, Bundler resolves 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 a little time for us as Ruby LSP maintainers to verify the compatibility, and make any necessary updates.

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

If Prism is locked to a newer version not yet supported by the Ruby LSP, then the only outcome that satisfies Bundler checks is to install the very old versions that depended on the old name 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
```
Comment on lines +59 to +66
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to tell folks to pin their Prism version. Once Prism v1 is out, we will relax our constraints and the issue will be greatly mitigated. Then how do we tell everybody to remove this from their gemfiles?

Copy link
Contributor Author

@andyw8 andyw8 May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not ideal. But in that time between a Prism release and the update to Ruby LSP, it's a lousy experience for developers.

One way to mitigate this could be align with Kevin so that when the next Prism release is ready, we verify it and pre-emptively bump the constraint a day or two before the actual Prism release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be a smoother option. Also, my understanding is that Prism is almost there with the v1.0.0, so this problem might be resolved very soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next release is going to be v1.0.0, so I'll let you know before it goes out and we can test it.


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

### Shell issues

Expand Down
Loading