mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 11:55:22 +00:00
lsp/presets/ols: init
This commit is contained in:
parent
e79b9ecc5b
commit
92a912a713
2 changed files with 30 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
./harper.nix
|
./harper.nix
|
||||||
./intelephense.nix
|
./intelephense.nix
|
||||||
./lemminx.nix
|
./lemminx.nix
|
||||||
|
./ols.nix
|
||||||
./openscad-lsp.nix
|
./openscad-lsp.nix
|
||||||
./phan.nix
|
./phan.nix
|
||||||
./phpactor.nix
|
./phpactor.nix
|
||||||
|
|
|
||||||
29
modules/plugins/lsp/presets/ols.nix
Normal file
29
modules/plugins/lsp/presets/ols.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.ols;
|
||||||
|
in {
|
||||||
|
options.vim.lsp.presets.ols = {
|
||||||
|
enable = mkEnableOption "the Odin Language Server";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim.lsp.servers.ols = {
|
||||||
|
enable = true;
|
||||||
|
cmd = [(getExe pkgs.ols)];
|
||||||
|
root_dir = mkLuaInline ''
|
||||||
|
function(bufnr, on_dir)
|
||||||
|
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
on_dir(util.root_pattern('ols.json', '.git', '*.odin')(fname))
|
||||||
|
end'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue