Skip to content

Commit 2b479d4

Browse files
committed
lsp: add unison support
1 parent 0818971 commit 2b479d4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/ide.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ let
4242
enable = true;
4343
type = "nil";
4444
};
45+
unison = true;
4546
rust.enable = false;
4647
ts = false;
4748
smithy.enable = false;

modules/lsp/lsp.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ in
2929
dhall = mkEnableOption "Dhall LSP";
3030
elm = mkEnableOption "Elm LSP";
3131
haskell = mkEnableOption "Haskell LSP (hls)";
32+
unison = mkEnableOption "Unison LSP";
3233

3334
scala = {
3435
enable = mkEnableOption "Scala LSP (Metals)";
@@ -112,6 +113,7 @@ in
112113
(withPlugins config.vim.autocomplete.enable [ cmp-nvim-lsp ]) ++
113114
(withPlugins cfg.sql [ sqls-nvim ]) ++
114115
(withPlugins cfg.scala.enable [ nvim-metals ]) ++
116+
(withPlugins cfg.unison [ pkgs.vimPlugins.unison ]) ++
115117
(withPlugins cfg.folds [ promise-async nvim-ufo ]) ++
116118
(withPlugins cfg.rust.enable [ crates-nvim rust-tools ]);
117119

@@ -446,6 +448,17 @@ in
446448
}
447449
''}
448450
451+
${writeIf cfg.unison ''
452+
-- Unison config
453+
lspconfig.unison.setup {
454+
capabilities = capabilities;
455+
on_attach = default_on_attach;
456+
cmd = { "nc", "localhost", "5757" };
457+
filetypes = { "unison" };
458+
root_dir = lspconfig.util.root_pattern("*.u");
459+
}
460+
''}
461+
449462
${writeIf cfg.scala.enable ''
450463
-- Scala nvim-metals config
451464
metals_config = require('metals').bare_config()

0 commit comments

Comments
 (0)