Skip to content

Commit

Permalink
chore(nvim): better support for ruby with custom gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
miszo committed Dec 17, 2024
1 parent 22e7e67 commit 2beb18c
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
12 changes: 12 additions & 0 deletions home/dot_config/exact_nvim/exact_lua/exact_plugins/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
{
'stevearc/conform.nvim',
optional = true,
opts = {
formatters_by_ft = {
ruby = { vim.g.lazyvim_ruby_formatter },
eruby = { 'prettier' },
},
},
},
}
33 changes: 33 additions & 0 deletions home/dot_config/exact_nvim/exact_lua/exact_plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,39 @@ return {
ruby_lsp = {
mason = false,
cmd = { vim.fn.expand('~/.asdf/shims/ruby-lsp') },
cmd_env = {
BUNDLE_GEMFILE = vim.fn.expand('~/.ruby-lsp/Gemfile'),
},
init_options = {
enabledFeatures = {
'codeActions',
'codeLens',
'completion',
'definition',
'diagnostics',
'documentHighlights',
'documentLink',
'documentSymbols',
'foldingRanges',
'formatting',
'hover',
'selectionRanges',
'semanticHighlighting',
'signatureHelp',
'typeHierarchy',
'workspaceSymbol',
},
experimentalFeaturesEnabled = false,
formatter = 'auto',
indexing = {
excludedPatterns = {
'**/test/**/*',
'**/spec/**/*',
'**/db/**/*',
'**/vendor/**/*',
},
},
},
},
eslint = {
root_dir = get_root_dir,
Expand Down
15 changes: 15 additions & 0 deletions home/exact_dot_ruby-lsp/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

source 'https://rubygems.org'

ruby file: '.tool-versions'

gem 'rubocop'
gem 'rubocop-packaging'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-rspec'
gem 'rubocop-shopify'
gem 'rubocop-thread_safety'
gem 'ruby-lsp'
gem 'test-prof'
1 change: 1 addition & 0 deletions home/exact_dot_ruby-lsp/dot_tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.2.3

0 comments on commit 2beb18c

Please sign in to comment.