mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 11:55:22 +00:00
lsp/presets/arduino-language-server: init
This commit is contained in:
parent
fb8816e67f
commit
df3f01d0c4
2 changed files with 47 additions and 0 deletions
46
modules/plugins/lsp/presets/arduino-language-server.nix
Normal file
46
modules/plugins/lsp/presets/arduino-language-server.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./arduino-language-server.nix
|
||||
./basedpyright.nix
|
||||
./deno.nix
|
||||
./harper.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue