2024-08-10 06:19:49 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
2024-06-18 17:14:05 +03:00
|
|
|
|
|
|
|
let inherit (lib.nix2lua) call; in
|
|
|
|
{
|
|
|
|
fn.lspconfig-eslint-on-attach = {
|
|
|
|
args = [ "client" "bufnr" ];
|
|
|
|
content = { bufnr, ... }: {
|
|
|
|
vim.augroup.eslint-fix = {
|
|
|
|
event = "BufWritePre";
|
|
|
|
buffer = bufnr;
|
|
|
|
command = "silent! EslintFixAll";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
plugins.language-server.lspconfig.serverSettings = {
|
|
|
|
nil_ls = { };
|
|
|
|
rust_analyzer = {
|
|
|
|
settings.rust-analyzer = {
|
|
|
|
"server.path" = "rust-analyzer";
|
|
|
|
"updates.prompt" = false;
|
|
|
|
"updates.checkOnStartup" = false;
|
|
|
|
"checkOnSave.enable" = true;
|
|
|
|
"checkOnSave.command" = "clippy";
|
|
|
|
"cargo.autoreload" = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
tsserver = rec {
|
|
|
|
filetypes = [ "javascript" "javascriptreact" "typescript" "typescriptreact" "vue" ];
|
2024-08-10 06:19:49 +03:00
|
|
|
cmd = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server --stdio";
|
|
|
|
init_options = {
|
|
|
|
plugins = [
|
|
|
|
{
|
|
|
|
name = "@vue/typescript-plugin";
|
|
|
|
location = "./node_modules/@vue/typescript-plugin";
|
|
|
|
languages = filetypes;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
tsserver.fallbackPath = "${pkgs.nodePackages.typescript}/lib/node_modules/typescript/lib";
|
|
|
|
};
|
2024-06-18 17:14:05 +03:00
|
|
|
};
|
|
|
|
eslint = {
|
|
|
|
on_attach = config.fn.lspconfig-eslint-on-attach.lambda;
|
|
|
|
};
|
|
|
|
volar = {
|
|
|
|
init_options = {
|
|
|
|
typescript.tsdk = "./node_modules/typescript/lib";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
ltex = {
|
|
|
|
language = "en-US";
|
|
|
|
languageToolHttpServerUri = "http://localhost:8081";
|
|
|
|
};
|
|
|
|
pylsp = { };
|
|
|
|
denols = {
|
|
|
|
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ];
|
|
|
|
};
|
|
|
|
jdtls = { cmd = [ "jdtls" ]; };
|
2024-08-07 02:42:16 +03:00
|
|
|
jsonls = {};
|
2024-06-18 17:14:05 +03:00
|
|
|
};
|
|
|
|
}
|