mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 19:25:58 +01:00
languages/r: removing toggle for wrappers
This commit is contained in:
parent
fbd15f5f3a
commit
b321c01047
1 changed files with 14 additions and 25 deletions
|
@ -21,13 +21,9 @@
|
|||
defaultFormat = "format_r";
|
||||
formats = {
|
||||
styler = {
|
||||
package =
|
||||
if cfg.useWrappedPackages
|
||||
then
|
||||
(pkgs.rWrapper.override {
|
||||
packages = with pkgs.rPackages; [styler];
|
||||
})
|
||||
else pkgs.rPackages.styler;
|
||||
package = pkgs.rWrapper.override {
|
||||
packages = with pkgs.rPackages; [styler];
|
||||
};
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
|
@ -39,13 +35,9 @@
|
|||
};
|
||||
|
||||
format_r = {
|
||||
package =
|
||||
if cfg.useWrappedPackages
|
||||
then
|
||||
(pkgs.rWrapper.override {
|
||||
packages = with pkgs.rPackages; [formatR];
|
||||
})
|
||||
else pkgs.rPackages.formatR;
|
||||
package = pkgs.rWrapper.override {
|
||||
packages = with pkgs.rPackages; [formatR];
|
||||
};
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
|
@ -60,16 +52,9 @@
|
|||
defaultServer = "r_language_server";
|
||||
servers = {
|
||||
r_language_server = {
|
||||
package =
|
||||
if cfg.useWrappedPackages
|
||||
then
|
||||
(pkgs.writeShellScriptBin "r_lsp" ''
|
||||
${r-with-languageserver}/bin/R --slave -e "languageserver::run()"
|
||||
'')
|
||||
else
|
||||
pkgs.writeShellScriptBin "r_lsp" ''
|
||||
R --slave -e "languageserver::run()"
|
||||
'';
|
||||
package = pkgs.writeShellScriptBin "r_lsp" ''
|
||||
${r-with-languageserver}/bin/R --slave -e "languageserver::run()"
|
||||
'';
|
||||
lspConfig = ''
|
||||
lspconfig.r_language_server.setup{
|
||||
capabilities = capabilities;
|
||||
|
@ -86,7 +71,6 @@
|
|||
in {
|
||||
options.vim.languages.r = {
|
||||
enable = mkEnableOption "R language support";
|
||||
useWrappedPackages = mkEnableOption "use rWrapper for packages to work without R in user's PATH" // {default = true;};
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
@ -95,13 +79,16 @@ in {
|
|||
|
||||
lsp = {
|
||||
enable = mkEnableOption "R LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "R LSP server to use";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "R LSP server package, or the command to run as a list of strings";
|
||||
example = literalExpression "[ (lib.getExe pkgs.jdt-language-server) \"-data\" \"~/.cache/jdtls/workspace\" ]";
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
|
@ -109,11 +96,13 @@ in {
|
|||
|
||||
format = {
|
||||
enable = mkEnableOption "R formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "R formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "R formatter package";
|
||||
type = package;
|
||||
|
|
Loading…
Reference in a new issue