blob: b7136c3ff5788a9fdc2d34a5864e5e77ecbf31c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
{
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.types) mkLspPresetEnableOption;
inherit (lib.meta) getExe getExe';
inherit (lib.generators) mkLuaInline;
cfg = config.vim.lsp.presets.arduino-language-server;
in {
options.vim.lsp.presets.arduino-language-server = {
enable = mkLspPresetEnableOption {
option = "arduino-language-server";
display = "Arduino";
};
};
config = mkIf cfg.enable {
vim.lsp.servers.arduino-language-server = {
enable = true;
cmd = [
(getExe pkgs.arduino-language-server)
"-clangd"
(getExe' pkgs.clang-tools "clangd")
"-cli"
(getExe pkgs.arduino-cli)
"-cli-config"
"$HOME/.arduino15/arduino-cli.yaml"
];
root_dir = mkLuaInline ''
function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
on_dir(util.root_pattern("*.ino")(fname))
end
'';
capabilities = {
textDocument = {
semanticTokens = mkLuaInline "vim.NIL";
};
workspace = {
semanticTokens = mkLuaInline "vim.NIL";
};
};
};
};
}
|