mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-22 18:28:46 +02:00
Refactor language servers and add eslint, jsonls, cssls and html servers. (#28)
* nvim-lsp: refactor of basic language servers * nvim-lsp: added html, css, json and eslint language servers * nvim-lsp: added gdscript lsp * nvim-lsp: added vuels
This commit is contained in:
parent
b1f99f2f08
commit
d40a8b99f3
9 changed files with 96 additions and 114 deletions
29
plugins/nvim-lsp/helpers.nix
Normal file
29
plugins/nvim-lsp/helpers.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
mkLsp = {
|
||||
name,
|
||||
description ? "Enable ${name}.",
|
||||
serverName ? name,
|
||||
packages ? [ pkgs.${name} ],
|
||||
... }:
|
||||
# returns a module
|
||||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.lsp.servers.${name};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.nixvim.plugins.lsp.servers.${name} = {
|
||||
enable = mkEnableOption description;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nixvim.extraPackages = packages;
|
||||
|
||||
programs.nixvim.plugins.lsp.enabledServers = [ serverName ];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue