mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
feat: make dart lsp install optional
This commit is contained in:
parent
35e86d1f12
commit
ed09cb7ed6
2 changed files with 11 additions and 3 deletions
|
@ -15,7 +15,11 @@ with builtins; let
|
||||||
lspconfig.dartls.setup{
|
lspconfig.dartls.setup{
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
on_attach=default_on_attach;
|
on_attach=default_on_attach;
|
||||||
cmd = {"${pkgs.dart}/bin/dart", "language-server", "--protocol=lsp"};
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then nvim.lua.expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/dart", "language-server", "--protocol=lsp"}''
|
||||||
|
};
|
||||||
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -15,7 +15,11 @@ with builtins; let
|
||||||
lspconfig.dartls.setup{
|
lspconfig.dartls.setup{
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
on_attach=default_on_attach;
|
on_attach=default_on_attach;
|
||||||
cmd = {"${pkgs.dart}/bin/dart", "language-server", "--protocol=lsp"};
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then nvim.lua.expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/dart", "language-server", "--protocol=lsp"}''
|
||||||
|
};
|
||||||
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
@ -39,7 +43,7 @@ in {
|
||||||
};
|
};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Dart LSP server package";
|
description = "Dart LSP server package";
|
||||||
type = types.package;
|
type = with types; either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
opts = mkOption {
|
opts = mkOption {
|
||||||
|
|
Loading…
Reference in a new issue