diff options
author | Christian Chiarulli <[email protected]> | 2021-07-24 21:17:11 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-24 21:17:11 -0400 |
commit | 98f8a77819670ce6012216e01885c135a6d3a289 (patch) | |
tree | b655da889c33e0eb89251878783700a8cd014a27 /lua/lang/ruby.lua | |
parent | 0884dcd84670bc097c34253e983d2cde9c209dfa (diff) |
New contract (#1080)
Changes to the global config object
O is now lvim
user_plugins is now plugins
user_autocommands is now autocommands
No more lang specific plugins
Null-ls has replaced both formatter.nvim and nvim-lint
Diffstat (limited to 'lua/lang/ruby.lua')
-rw-r--r-- | lua/lang/ruby.lua | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/lua/lang/ruby.lua b/lua/lang/ruby.lua deleted file mode 100644 index 1975acfd..00000000 --- a/lua/lang/ruby.lua +++ /dev/null @@ -1,77 +0,0 @@ -local M = {} - -M.config = function() - O.lang.ruby = { - diagnostics = { - virtualtext = { spacing = 0, prefix = "ï„‘" }, - signs = true, - underline = true, - }, - filetypes = { "rb", "erb", "rakefile", "ruby" }, - formatter = { - exe = "rufo", - args = { "-x" }, - stdin = true, - }, - linters = { "ruby" }, - lsp = { - path = DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", - }, - } -end - -M.format = function() - O.formatters.filetype["ruby"] = { - function() - return { - exe = O.lang.ruby.formatter.exe, - args = O.lang.ruby.formatter.args, - stdin = O.lang.ruby.formatter.stdin, - } - end, - } - - require("formatter.config").set_defaults { - logging = false, - filetype = O.formatters.filetype, - } -end - -M.lint = function() - require("lint").linters_by_ft = { - ruby = O.lang.ruby.linters, - } -end - -M.lsp = function() - if not require("lv-utils").check_lsp_client_active "sorbet" then - require("lspconfig").sorbet.setup {} - end - - if not require("lv-utils").check_lsp_client_active "solargraph" then - -- If you are using rvm, make sure to change below configuration - require("lspconfig").solargraph.setup { - cmd = { O.lang.ruby.lsp.path, "stdio" }, - on_attach = require("lsp").common_on_attach, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.ruby.diagnostics.virtual_text, - signs = O.lang.ruby.diagnostics.signs, - underline = O.lang.ruby.diagnostics.underline, - update_in_insert = true, - }), - }, - filetypes = O.lang.ruby.filetypes, - } - end -end - -M.dap = function() - -- gem install readapt ruby-debug-ide - if O.plugin.dap.active then - local dap_install = require "dap-install" - dap_install.config("ruby_vsc_dbg", {}) - end -end - -return M |