Add vscode Ruby LSP config and documentation

This commit is contained in:
Rylan Polster 2024-08-02 02:18:10 -04:00
parent 53e363258a
commit 9ddde17ea5
No known key found for this signature in database
8 changed files with 32 additions and 8 deletions

View File

@ -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",

View File

@ -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",

2
.gitignore vendored
View File

@ -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-*/
@ -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-*/

View File

@ -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",

13
.vscode/settings.json vendored
View File

@ -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",

View File

@ -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

View File

@ -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)
@ -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)
@ -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)
@ -177,6 +185,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rspec
rubocop-sorbet
ruby-lsp
ruby-macho
ruby-prof
ruby-progressbar

View File

@ -58,6 +58,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_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")
@ -75,6 +76,8 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_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")
@ -94,6 +97,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_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")