diff --git a/docs/manual/languages.adoc b/docs/manual/languages.adoc index edc70e70..2b70aaf2 100644 --- a/docs/manual/languages.adoc +++ b/docs/manual/languages.adoc @@ -15,6 +15,7 @@ Language specific support means there is a combination of language specific plug * SQL: <> * Dart: <> * Go: <> +* Ruby: <> Adding support for more languages, and improving support for existing ones are great places where you can contribute with a PR. diff --git a/modules/languages/default.nix b/modules/languages/default.nix index dbf5244b..e8b541d0 100644 --- a/modules/languages/default.nix +++ b/modules/languages/default.nix @@ -12,8 +12,8 @@ in { ./tidal ./dart ./elixir - ./ruby + ./ruby.nix ./clang.nix ./go.nix ./nix.nix diff --git a/modules/languages/ruby/ruby.nix b/modules/languages/ruby.nix similarity index 67% rename from modules/languages/ruby/ruby.nix rename to modules/languages/ruby.nix index 0cbb6032..0b6cb9f2 100644 --- a/modules/languages/ruby/ruby.nix +++ b/modules/languages/ruby.nix @@ -28,14 +28,24 @@ with builtins; let lspConfig = '' lspconfig.rubocop.setup { on_attach = attach_keymaps, - cmd = { "${cfg.lsp.package}/bin/bundle", "exec", "rubocop", "--lsp" }, + cmd = { "rubocop", "--lsp" }, } ''; }; }; in { options.vim.languages.ruby = { - enable = mkEnableOption "Ruby/Ruby on Rails language support"; + enable = mkEnableOption '' + Ruby/Ruby on Rails language support. + + CAUTION: Ruby relies on your system for your project's dependencies, and it works the other way around too for code quality checking softwares. + + What that means is you have to have: + * The language server(rubocop or solargraph) specified in your Gemfile + * Your project's gems installed on your system + + You can either install them declaratively, or use a `shell.nix` along with a bundix setup to make your dependenicies available (special mention to libv8-node, which you cannot install via a gemset.nix due to it downloading nodejs with wget...) + ''; treesitter = { enable = mkEnableOption "Enable Ruby treesitter" // {default = config.vim.languages.enableTreesitter;}; @@ -52,7 +62,7 @@ in { }; package = mkOption { - description = "Ruby/RoR LSP server package"; + description = "Ruby package to use for ruby LSP (important if you have a specific version of ruby)"; type = types.package; default = servers.${cfg.lsp.server}.package; }; diff --git a/modules/languages/ruby/default.nix b/modules/languages/ruby/default.nix deleted file mode 100644 index 2abc62cd..00000000 --- a/modules/languages/ruby/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - imports = [ - ./ruby.nix - ]; -}