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

Commit

Permalink
Implement internal Ruby activation mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Jan 19, 2024
1 parent ba7ac82 commit 456f287
Show file tree
Hide file tree
Showing 12 changed files with 674 additions and 433 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,31 @@ jobs:
node-version: "18"
cache: "yarn"

# We need some Ruby installed for the environment activation tests
# We need some Ruby installed for the environment activation tests. The Ruby version installed here needs to match
# the one we're using the ruby.test.ts file
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.2.2"

# On GitHub actions, the Ruby binary is installed in a path that's not really standard for version managers. We
# create a symlink using a standard path so that we test the same behaviour as in development machines
- name: Symlink Ruby on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
mkdir /opt/rubies
ln -s /opt/hostedtoolcache/Ruby/3.2.2/x64 /opt/rubies/3.2.2
- name: Symlink Ruby on MacOS
if: matrix.os == 'macos-latest'
run: |
mkdir /Users/runner/.rubies
ln -s /Users/runner/hostedtoolcache/Ruby/3.2.2/x64 /Users/runner/.rubies/3.2.2
- name: Symlink Ruby on Windows
if: matrix.os == 'windows-latest'
run: |
New-Item -Path C:\Ruby32-x64 -ItemType SymbolicLink -Value C:\hostedtoolcache\windows\Ruby\3.2.2\x64
- name: 📦 Install dependencies
run: yarn --frozen-lockfile
Expand Down
35 changes: 8 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ruby-lsp",
"displayName": "Ruby LSP",
"description": "VS Code plugin for connecting with the Ruby LSP",
"version": "0.5.8",
"version": "0.6.6",
"publisher": "Shopify",
"repository": {
"type": "git",
Expand Down Expand Up @@ -56,8 +56,8 @@
"category": "Ruby LSP"
},
{
"command": "rubyLsp.selectRubyVersionManager",
"title": "Select Ruby version manager",
"command": "rubyLsp.changeRubyVersion",
"title": "Change Ruby version",
"category": "Ruby LSP"
},
{
Expand Down Expand Up @@ -243,30 +243,6 @@
}
}
},
"rubyLsp.rubyVersionManager": {
"description": "The Ruby version manager to use",
"type": "string",
"enum": [
"asdf",
"auto",
"chruby",
"none",
"rbenv",
"rvm",
"shadowenv",
"custom"
],
"default": "auto"
},
"rubyLsp.customRubyCommand": {
"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'",
"type": "string"
},
"rubyLsp.yjit": {
"description": "Use YJIT to speed up the Ruby LSP server",
"type": "boolean",
"default": true
},
"rubyLsp.formatter": {
"description": "Which tool the Ruby LSP should use for formatting files",
"type": "string",
Expand All @@ -288,6 +264,11 @@
"type": "integer",
"default": 30
},
"rubyLsp.rubyExecutablePath": {
"description": "Specify the path for a Ruby executable to use for the Ruby LSP server on all projects",
"type": "string",
"default": ""
},
"rubyLsp.branch": {
"description": "Run the Ruby LSP server from the specified branch rather than using the released gem. Only supported if not using bundleGemfile",
"type": "string",
Expand Down
7 changes: 2 additions & 5 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export enum Command {
Update = "rubyLsp.update",
ToggleExperimentalFeatures = "rubyLsp.toggleExperimentalFeatures",
ServerOptions = "rubyLsp.serverOptions",
ToggleYjit = "rubyLsp.toggleYjit",
SelectVersionManager = "rubyLsp.selectRubyVersionManager",
ChangeRubyVersion = "rubyLsp.changeRubyVersion",
ToggleFeatures = "rubyLsp.toggleFeatures",
FormatterHelp = "rubyLsp.formatterHelp",
RunTest = "rubyLsp.runTest",
Expand All @@ -24,10 +23,8 @@ export enum Command {
}

export interface RubyInterface {
error: boolean;
versionManager?: string;
rubyVersion?: string;
supportsYjit?: boolean;
yjitEnabled?: boolean;
}

export interface ClientInterface {
Expand Down
Loading

0 comments on commit 456f287

Please sign in to comment.