system/neovim/configs/language-server.nix

83 lines
1.9 KiB
Nix
Raw Normal View History

2024-08-14 01:20:44 +03:00
{ config, lib, pkgs, ... }:
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 = {
2024-08-10 23:02:08 +03:00
# nix
nil_ls = { };
2024-08-10 23:02:08 +03:00
# rust
rust_analyzer = {
settings.rust-analyzer = {
"server.path" = "rust-analyzer";
"updates.prompt" = false;
"updates.checkOnStartup" = false;
"checkOnSave.enable" = true;
"checkOnSave.command" = "clippy";
"cargo.autoreload" = true;
};
};
2024-08-10 23:02:08 +03:00
# linter for javascript, typescript, vue
eslint = {
on_attach = config.fn.lspconfig-eslint-on-attach.lambda;
flags = {
allow_incremental_sync = false;
debounce_text_changes = 1000;
};
};
2024-08-10 23:02:08 +03:00
# vue
volar = {
init_options = {
typescript.tsdk = "./node_modules/typescript/lib";
};
};
2024-08-10 23:02:08 +03:00
# python
pylsp = { };
2024-08-10 23:02:08 +03:00
# typescript, javascript
denols = {
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ];
};
2024-08-10 23:02:08 +03:00
# java
2024-08-14 01:20:44 +03:00
jdtls = {
cmd = [ "${pkgs.jdt-language-server}/bin/jdtls" ];
};
2024-08-10 23:02:08 +03:00
# json
2024-08-10 06:25:55 +03:00
jsonls = { };
2024-08-10 23:02:08 +03:00
# css, scss, less
cssls = {};
2024-08-11 22:49:54 +03:00
css_variables = {
lookupFiles = [
"**/*.scss"
"**/*.less"
"**/*.css"
];
};
2024-08-10 23:02:08 +03:00
# Grammar/Spell Checker
ltex = {
language = "en-US";
languageToolHttpServerUri = "http://localhost:8081";
};
};
2024-08-10 18:17:50 +03:00
plugins.language-server.typescript-tools = {
enable = true;
serverSettings = {
filetypes = [ "javascript" "javascriptreact" "typescript" "typescriptreact" "vue" ];
settings = {
tsserver_max_memory = "auto";
tsserver_plugins = [ "@vue/typescript-plugin" ];
};
};
};
}