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 Feb 9, 2024
1 parent f941025 commit a98af41
Show file tree
Hide file tree
Showing 14 changed files with 830 additions and 444 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.3"
ruby-version: "3.3.0"

# 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.3.0/x64 /opt/rubies/3.3.0
- name: Symlink Ruby on MacOS
if: matrix.os == 'macos-latest'
run: |
mkdir /Users/runner/.rubies
ln -s /Users/runner/hostedtoolcache/Ruby/3.3.0/x64 /Users/runner/.rubies/3.3.0
- name: Symlink Ruby on Windows
if: matrix.os == 'windows-latest'
run: |
New-Item -Path C:\Ruby33-x64 -ItemType SymbolicLink -Value C:\hostedtoolcache\windows\Ruby\3.3.0\x64
- name: 📦 Install dependencies
run: yarn --frozen-lockfile
Expand Down
37 changes: 10 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.10",
"version": "0.6.8",
"publisher": "Shopify",
"repository": {
"type": "git",
Expand Down Expand Up @@ -57,8 +57,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 @@ -244,30 +244,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 @@ -289,6 +265,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 Expand Up @@ -494,6 +475,7 @@
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.6",
"@types/node": "20.x",
"@types/sinon": "^17.0.3",
"@types/vscode": "^1.68.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand All @@ -507,6 +489,7 @@
"mocha": "^10.2.0",
"ovsx": "^0.8.3",
"prettier": "^3.2.5",
"sinon": "^17.0.1",
"typescript": "^5.3.3",
"vscode-oniguruma": "^2.0.1",
"vscode-textmate": "^9.0.0"
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 a98af41

Please sign in to comment.