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

Use activated gem paths to register document selectors #2718

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

vinistock
Copy link
Member

Motivation

Closes #2709

We were using the environment variable GEM_PATH to register the LSP client's document selector, so that people can use the Ruby LSP's features inside gem source code. Unfortunately, that won't work for shim based version managers because they don't actually set that environment variable, so we never register the document selector and navigation is unavailable.

Implementation

I recommend reviewing per commit:

  1. The first one starts returning the Gem.path from our activation scripts. Even for shim based version managers, that method is still going to return the array of directories where gems should be installed
  2. Then we start using the new gemPath field to register the document selector instead of relying on the environment variable

Automated Tests

Added a new test.

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels Oct 12, 2024
@vinistock vinistock self-assigned this Oct 12, 2024
@vinistock vinistock requested a review from a team as a code owner October 12, 2024 14:43
@vinistock vinistock requested review from andyw8 and st0012 October 12, 2024 14:43
@vinistock vinistock merged commit c5e248d into main Oct 17, 2024
35 checks passed
@vinistock vinistock deleted the vs-return-gem-path-from-activation-scripts branch October 17, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client doesn't register dependency paths for version managers based on shims
2 participants