Update Ruby LSP config to install necessary gems automatically

This commit is contained in:
Rylan Polster 2024-08-02 15:52:58 -04:00
parent 9f260a4490
commit b26bf95288
No known key found for this signature in database
5 changed files with 9 additions and 4 deletions

View File

@ -13,7 +13,6 @@
// Installing all necessary extensions for vscode
// Taken from: .vscode/extensions.json
"extensions": [
"kaiwood.endwise",
"Shopify.ruby-lsp",
"sorbet.sorbet-vscode-extension",
"github.vscode-github-actions",

View File

@ -13,7 +13,6 @@
// Installing all necessary extensions for vscode
// Taken from: .vscode/extensions.json
"extensions": [
"kaiwood.endwise",
"Shopify.ruby-lsp",
"sorbet.sorbet-vscode-extension",
"github.vscode-github-actions",

View File

@ -1,6 +1,5 @@
{
"recommendations": [
"kaiwood.endwise",
"Shopify.ruby-lsp",
"sorbet.sorbet-vscode-extension",
"github.vscode-github-actions",

7
.vscode/ruby-lsp-activate.sh vendored Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
HOMEBREW_PREFIX="$(cd "$(dirname "$0")"/../ && pwd)/"
"${HOMEBREW_PREFIX}bin/brew" install-bundler-gems --add-groups=style,typecheck,vscode >/dev/null 2>&1
export PATH="${HOMEBREW_PREFIX}/Library/Homebrew/vendor/portable-ruby/current/bin:${PATH}"
export BUNDLE_WITH="style:typecheck:vscode"

View File

@ -9,12 +9,13 @@
"rubyLsp.rubyVersionManager": {
"identifier": "custom"
},
"rubyLsp.customRubyCommand": "PATH=${workspaceFolder}/Library/Homebrew/vendor/portable-ruby/current/bin:$PATH",
"rubyLsp.customRubyCommand": "source ../../.vscode/ruby-lsp-activate.sh",
"rubyLsp.bundleGemfile": "Library/Homebrew/Gemfile",
"rubyLsp.formatter": "rubocop",
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.semanticHighlighting.enabled": true,
},
"shellcheck.customArgs": [