Skip to content

Commit fdc3e0c

Browse files
andyw8dirceuvinistockst0012
authored
Add outdated version info to troubleshooting guide (#2060)
* Add outdated version info to troubleshooting guide [skip ci] * Update TROUBLESHOOTING.md Co-authored-by: Dirceu Pereira Tiegs <[email protected]> * Update TROUBLESHOOTING.md Co-authored-by: Dirceu Pereira Tiegs <[email protected]> * Update TROUBLESHOOTING.md * Update TROUBLESHOOTING.md * Update TROUBLESHOOTING.md Co-authored-by: Vinicius Stock <[email protected]> * Update TROUBLESHOOTING.md Co-authored-by: Vinicius Stock <[email protected]> * Update to mention RBS * Update version example * Update TROUBLESHOOTING.md Co-authored-by: Vinicius Stock <[email protected]> * Update TROUBLESHOOTING.md Co-authored-by: Vinicius Stock <[email protected]> * Fix markdown syntax * Clarify about addons * Fix formatting * Fix formatting * Update TROUBLESHOOTING.md Co-authored-by: Stan Lo <[email protected]> * Add link to status centre image * Fix wording --------- Co-authored-by: Andy Waite <[email protected]> Co-authored-by: Dirceu Pereira Tiegs <[email protected]> Co-authored-by: Vinicius Stock <[email protected]> Co-authored-by: Stan Lo <[email protected]>
1 parent a5e1775 commit fdc3e0c

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

DESIGN_AND_ROADMAP.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ If you require more accuracy in your editor, consider adopting a type system and
6767
This applies to multiple language server features such as go to definition, hover, completion and automated refactors.
6868
Consider the following examples:
6969

70-
> [!NOTE] not all of the examples below are supported at the moment and this is not an exhaustive list. Please check the
71-
long term roadmap to see what’s planned
70+
> [!NOTE]
71+
> Not all of the examples below are supported at the moment and this is not an exhaustive list.
72+
> Please check the long term roadmap to see what’s planned
7273
7374
```ruby
7475
# Cases where we can provide a satisfactory experience without a type system
@@ -233,7 +234,8 @@ user.name
233234
@post.like!
234235
```
235236

236-
> [!IMPORTANT] The goal of this experiment is to understand if we can get better accuracy for the code that you already
237+
> [!IMPORTANT]
238+
> The goal of this experiment is to understand if we can get better accuracy for the code that you already
237239
> have. The hypothesis is that a reasonable amount of code already uses patterns like the ones in the example and, in
238240
> those cases, we can achieve nicer results.
239241
>

TROUBLESHOOTING.md

+41-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,47 @@ to index for features such as go to definition.
3636
3737
## Common issues
3838

39-
There are two main sources of issues users typically face during activation: shell or Bundler related problems.
39+
There are several main sources of issues users typically face during activation: outdated version, shell problems, or Bundler related problems.
40+
41+
### Outdated Version
42+
43+
> [!NOTE]
44+
> If using VS Code, the version of the extension is distinct from that of the server (the `ruby-lsp` gem). You can check the server version in the [status center](https://github.com/Shopify/ruby-lsp/blob/main/vscode/extras/ruby_lsp_status_center.png).
45+
46+
In most cases, the server gem will be automatically updated. You can also trigger a manual update with the "Update language server gem" command in VS Code.
47+
48+
You can also attempt an update from the command line with `BUNDLE_GEMFILE=.ruby-lsp/Gemfile bundle update ruby-lsp`
49+
50+
> [!NOTE]
51+
> If you're using any addon gem, such as `ruby-lsp-rspec`, then `ruby-lsp` will also be present in your `Gemfile.lock` and it's possible that an outdated addon could prevent `ruby-lsp` from updating.
52+
53+
A common problem is that the `ruby-lsp` gem cannot be updated due to another dependency's constraints:
54+
55+
**Prism constraints**
56+
57+
Since v0.12.0, Ruby LSP has had a dependency on the [Prism](https://rubygems.org/gems/prism) parser.
58+
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 issues.
59+
Since Prism is a pre-1.0 release, there may be breaking changes introduced in minor versions.
60+
For that reason, we constrain the version of Prism up to that which is known to be compatible.
61+
62+
With the custom bundle approach described earlier, Bundler resolves a version of Ruby LSP which is compatible the dependencies already in your `Gemfile.lock.`
63+
64+
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.
65+
66+
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.
67+
68+
If Prism is locked to a newer version not yet supported by the Ruby LSP, then the only outcome that satisfies Bundler's checks is to install the very old versions that depend on the old name YARP.
69+
70+
Once Prism v1.0 is released, we will relax the version constraint to alleviate this problem.
71+
72+
**Other constraints**
73+
74+
Ruby LSP has a dependency on [RBS](https://github.com/ruby/rbs) v3.
75+
If another gem constrains the version of RBS to an older release, it will not be possible to use newer versions of Ruby LSP.
76+
77+
There is also dependency on `sorbet-runtime` which is used by a number of other gems.
78+
79+
Running `BUNDLE_GEMFILE=.ruby-lsp/Gemfile bundle outdated` may help with understanding what is being constrained.
4080

4181
### Shell issues
4282

0 commit comments

Comments
 (0)