mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 03:47:37 +00:00
lsp/presets/nushell: init
This commit is contained in:
parent
16753bfc52
commit
2af349436f
2 changed files with 30 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
./harper.nix
|
||||
./intelephense.nix
|
||||
./lemminx.nix
|
||||
./nushell.nix
|
||||
./ocaml-lsp.nix
|
||||
./ols.nix
|
||||
./openscad-lsp.nix
|
||||
|
|
|
|||
29
modules/plugins/lsp/presets/nushell.nix
Normal file
29
modules/plugins/lsp/presets/nushell.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
cfg = config.vim.lsp.presets.nushell;
|
||||
in {
|
||||
options.vim.lsp.presets.nushell = {
|
||||
enable = mkEnableOption "the NuShell Language Server";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.nushell = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.nushell) "--no-config-file" "--lsp"];
|
||||
root_dir = mkLuaInline ''
|
||||
function(bufnr, on_dir)
|
||||
on_dir(vim.fs.root(bufnr, { '.git' }) or vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)))
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue