Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add vscode Ruby LSP config #17934

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
// Taken from: .vscode/extensions.json
"extensions": [
"kaiwood.endwise",
"lorankloeze.ruby-rubocop-revived",
"rebornix.ruby",
"Shopify.ruby-lsp",
"sorbet.sorbet-vscode-extension",
"github.vscode-github-actions",
"timonwong.shellcheck",
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/ubuntu18.04/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
// Taken from: .vscode/extensions.json
"extensions": [
"kaiwood.endwise",
"lorankloeze.ruby-rubocop-revived",
"rebornix.ruby",
"Shopify.ruby-lsp",
"sorbet.sorbet-vscode-extension",
"github.vscode-github-actions",
"timonwong.shellcheck",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
**/vendor/bundle/ruby/*/gems/racc-*/
**/vendor/bundle/ruby/*/gems/rainbow-*/
**/vendor/bundle/ruby/*/gems/rbi-*/
**/vendor/bundle/ruby/*/gems/rbs-*/
**/vendor/bundle/ruby/*/gems/rdoc-*/
**/vendor/bundle/ruby/*/gems/redcarpet-*/
**/vendor/bundle/ruby/*/gems/regexp_parser-*/
Expand All @@ -120,6 +121,7 @@
**/vendor/bundle/ruby/*/gems/rspec-support-*/
**/vendor/bundle/ruby/*/gems/rspec-sorbet-*/
**/vendor/bundle/ruby/*/gems/rubocop-*/
**/vendor/bundle/ruby/*/gems/ruby-lsp-*/
**/vendor/bundle/ruby/*/gems/ruby-prof-*/
**/vendor/bundle/ruby/*/gems/ruby-progressbar-*/
**/vendor/bundle/ruby/*/gems/simplecov-*/
Expand Down
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"recommendations": [
"kaiwood.endwise",
"lorankloeze.ruby-rubocop-revived",
"rebornix.ruby",
"Shopify.ruby-lsp",
"sorbet.sorbet-vscode-extension",
"github.vscode-github-actions",
"timonwong.shellcheck",
Expand Down
13 changes: 11 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"ruby.useLanguageServer": true,
"ruby.rubocop.executePath": "Library/Homebrew/shims/gems/",
"rubyLsp.rubyVersionManager": {
"identifier": "custom"
},
"rubyLsp.customRubyCommand": "PATH=${workspaceFolder}/Library/Homebrew/vendor/portable-ruby/current/bin:$PATH",
"rubyLsp.bundleGemfile": "Library/Homebrew/Gemfile",
"rubyLsp.formatter": "rubocop",
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp",
"editor.formatOnSave": true,
"editor.semanticHighlighting.enabled": true,
},
"shellcheck.customArgs": [
"--shell=bash",
"--enable=all",
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ group :typecheck, optional: true do
gem "spoom", require: false
gem "tapioca", require: false
end
group :vscode, optional: true do
gem "ruby-lsp", require: false
end

# shared gems (used by multiple groups)
group :audit, :bump_unversioned_casks, :livecheck, optional: true do
Expand Down
9 changes: 9 additions & 0 deletions Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GEM
kramdown (2.4.0)
rexml
language_server-protocol (3.17.0.3)
logger (1.6.0)
method_source (1.1.0)
minitest (5.24.1)
netrc (0.11.0)
Expand Down Expand Up @@ -52,6 +53,8 @@ GEM
rbi (0.1.14)
prism (>= 0.18.0, < 1.0.0)
sorbet-runtime (>= 0.5.9204)
rbs (3.5.2)
logger
redcarpet (3.6.0)
regexp_parser (2.9.2)
rexml (3.3.4)
Expand Down Expand Up @@ -99,6 +102,11 @@ GEM
rubocop (~> 1.61)
rubocop-sorbet (0.8.5)
rubocop (>= 1)
ruby-lsp (0.17.10)
language_server-protocol (~> 3.17.0)
prism (>= 0.29.0, < 0.31)
rbs (>= 3, < 4)
sorbet-runtime (>= 0.5.10782)
ruby-macho (4.1.0)
ruby-prof (1.7.0)
ruby-progressbar (1.13.0)
Expand Down Expand Up @@ -177,6 +185,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rspec
rubocop-sorbet
ruby-lsp
ruby-macho
ruby-prof
ruby-progressbar
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/vendor/bundle/bundler/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def self.extension_api_version
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rexml-3.3.4/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/kramdown-2.4.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/language_server-protocol-3.17.0.3/lib")
$:.unshift File.expand_path("#{__dir__}/../../portable-ruby/3.3.4/lib/ruby/gems/3.3.0/gems/logger-1.6.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/method_source-1.1.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.24.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/netrc-0.11.0/lib")
Expand All @@ -75,6 +76,8 @@ def self.extension_api_version
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prism-0.30.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pry-0.14.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.1.14/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rbs-3.5.2")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbs-3.5.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/redcarpet-3.6.0")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/redcarpet-3.6.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-support-3.13.1/lib")
Expand All @@ -94,6 +97,7 @@ def self.extension_api_version
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.21.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-3.0.3/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.8.5/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-lsp-0.17.10/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-macho-4.1.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/ruby-prof-1.7.0")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-prof-1.7.0/lib")
Expand Down
Loading