Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 7f64d9f

Browse files
committed
Implement internal Ruby activation mechanism
1 parent 8b3254c commit 7f64d9f

File tree

12 files changed

+543
-435
lines changed

12 files changed

+543
-435
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@ jobs:
1515
node-version: "18"
1616
cache: "yarn"
1717

18-
# We need some Ruby installed for the environment activation tests
18+
# We need some Ruby installed for the environment activation tests. The Ruby version installed here needs to match
19+
# the ones we're using the ruby.test.ts file
1920
- name: Set up Ruby
2021
uses: ruby/setup-ruby@v1
2122
with:
22-
ruby-version: "3.2"
23+
ruby-version: "3.2.2"
24+
25+
# On GitHub actions, the Ruby binary is installed in a path that's not really standard for version managers. We
26+
# create a symlink using a standard path so that we test the same behaviour as in development machines
27+
- name: Symlink Ruby
28+
run: |
29+
mkdir /opt/rubies
30+
ln -s /opt/hostedtoolcache/Ruby/3.2.2/x64 /opt/rubies/3.2.2
2331
2432
- name: 📦 Install dependencies
2533
run: yarn --frozen-lockfile

package.json

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"category": "Ruby LSP"
5757
},
5858
{
59-
"command": "rubyLsp.selectRubyVersionManager",
60-
"title": "Select Ruby version manager",
59+
"command": "rubyLsp.changeRubyVersion",
60+
"title": "Change Ruby version",
6161
"category": "Ruby LSP"
6262
},
6363
{
@@ -207,30 +207,6 @@
207207
"references": true
208208
}
209209
},
210-
"rubyLsp.rubyVersionManager": {
211-
"description": "The Ruby version manager to use",
212-
"type": "string",
213-
"enum": [
214-
"asdf",
215-
"auto",
216-
"chruby",
217-
"none",
218-
"rbenv",
219-
"rvm",
220-
"shadowenv",
221-
"custom"
222-
],
223-
"default": "auto"
224-
},
225-
"rubyLsp.customRubyCommand": {
226-
"description": "A shell command to activate the right Ruby version or add a custom Ruby bin folder to the PATH. Only used if rubyVersionManager is set to 'custom'",
227-
"type": "string"
228-
},
229-
"rubyLsp.yjit": {
230-
"description": "Use YJIT to speed up the Ruby LSP server",
231-
"type": "boolean",
232-
"default": true
233-
},
234210
"rubyLsp.formatter": {
235211
"description": "Which tool the Ruby LSP should use for formatting files",
236212
"type": "string",
@@ -252,6 +228,11 @@
252228
"type": "integer",
253229
"default": 30
254230
},
231+
"rubyLsp.rubyExecutablePath": {
232+
"description": "Specify the path for a Ruby executable to use for the Ruby LSP server on all projects",
233+
"type": "string",
234+
"default": ""
235+
},
255236
"rubyLsp.branch": {
256237
"description": "Run the Ruby LSP server from the specified branch rather than using the released gem. Only supported if not using bundleGemfile",
257238
"type": "string",

src/common.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ export enum Command {
1212
Update = "rubyLsp.update",
1313
ToggleExperimentalFeatures = "rubyLsp.toggleExperimentalFeatures",
1414
ServerOptions = "rubyLsp.serverOptions",
15-
ToggleYjit = "rubyLsp.toggleYjit",
16-
SelectVersionManager = "rubyLsp.selectRubyVersionManager",
15+
ChangeRubyVersion = "rubyLsp.changeRubyVersion",
1716
ToggleFeatures = "rubyLsp.toggleFeatures",
1817
FormatterHelp = "rubyLsp.formatterHelp",
1918
RunTest = "rubyLsp.runTest",
@@ -24,10 +23,8 @@ export enum Command {
2423
}
2524

2625
export interface RubyInterface {
27-
error: boolean;
28-
versionManager?: string;
2926
rubyVersion?: string;
30-
supportsYjit?: boolean;
27+
yjitEnabled?: boolean;
3128
}
3229

3330
export interface ClientInterface {

0 commit comments

Comments
 (0)