lsp/presets/arduino-language-server: init

This commit is contained in:
Snoweuph 2026-04-12 00:13:25 +02:00
commit df3f01d0c4
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib.generators) mkLuaInline;
cfg = config.vim.lsp.presets.arduino-language-server;
in {
options.vim.lsp.presets.arduino-language-server = {
enable = mkEnableOption "the Arduino Language Server";
};
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";
};
};
};
};
}

View file

@ -1,5 +1,6 @@
{
imports = [
./arduino-language-server.nix
./basedpyright.nix
./deno.nix
./harper.nix