2022-07-28 21:37:49 +02:00
|
|
|
{ pkgs, config, lib, ... }@args:
|
2023-01-10 23:47:52 +01:00
|
|
|
with lib;
|
2022-07-28 21:37:49 +02:00
|
|
|
let
|
|
|
|
helpers = import ./helpers.nix args;
|
|
|
|
servers = [
|
2023-01-24 00:04:37 +00:00
|
|
|
{
|
|
|
|
name = "astro";
|
|
|
|
description = "Enable astrols, for Astro";
|
|
|
|
package = pkgs.nodePackages."@astrojs/language-server";
|
2023-01-24 00:08:11 +00:00
|
|
|
cmd = cfg: [ "${cfg.package}/bin/astro-ls" "--stdio" ];
|
2023-01-24 00:04:37 +00:00
|
|
|
}
|
2023-01-10 13:41:47 +01:00
|
|
|
{
|
|
|
|
name = "bashls";
|
|
|
|
description = "Enable bashls, for bash.";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.bash-language-server;
|
2023-01-10 13:41:47 +01:00
|
|
|
}
|
2022-07-28 21:37:49 +02:00
|
|
|
{
|
|
|
|
name = "clangd";
|
|
|
|
description = "Enable clangd LSP, for C/C++.";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.clang-tools;
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "cssls";
|
|
|
|
description = "Enable cssls, for CSS";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.vscode-langservers-extracted;
|
|
|
|
cmd = cfg: [ "${cfg.package}/bin/vscode-css-language-server" "--stdio" ];
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
2023-01-10 23:47:52 +01:00
|
|
|
{
|
|
|
|
name = "dartls";
|
|
|
|
description = "Enable dart language-server, for dart";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.dart;
|
2023-01-23 14:52:46 +01:00
|
|
|
settingsOptions = {
|
2023-01-10 23:47:52 +01:00
|
|
|
analysisExcludedFolders = mkOption {
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
default = null;
|
|
|
|
description = ''
|
2023-01-21 18:12:09 +01:00
|
|
|
An array of paths (absolute or relative to each workspace folder) that should be
|
2023-01-10 23:47:52 +01:00
|
|
|
excluded from analysis.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
enableSdkFormatter = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
2023-01-21 18:12:09 +01:00
|
|
|
When set to false, prevents registration (or unregisters) the SDK formatter. When set
|
2023-01-10 23:47:52 +01:00
|
|
|
to true or not supplied, will register/reregister the SDK formatter
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
lineLength = mkOption {
|
|
|
|
type = types.nullOr types.int;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
2023-01-21 18:12:09 +01:00
|
|
|
The number of characters the formatter should wrap code at. If unspecified, code will
|
2023-01-10 23:47:52 +01:00
|
|
|
be wrapped at 80 characters.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
completeFunctionCalls = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
When set to true, completes functions/methods with their required parameters.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
showTodos = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = true;
|
|
|
|
description = ''
|
2023-01-21 18:12:09 +01:00
|
|
|
Whether to generate diagnostics for TODO comments. If unspecified, diagnostics will not
|
2023-01-10 23:47:52 +01:00
|
|
|
be generated.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
renameFilesWithClasses = mkOption {
|
|
|
|
type = types.nullOr (types.enum [ "always" "prompt" ]);
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
When set to "always", will include edits to rename files when classes are renamed if the
|
|
|
|
filename matches the class name (but in snake_form). When set to "prompt", a prompt will
|
|
|
|
be shown on each class rename asking to confirm the file rename. Otherwise, files will
|
|
|
|
not be renamed. Renames are performed using LSP's ResourceOperation edits - that means
|
|
|
|
the rename is simply included in the resulting WorkspaceEdit and must be handled by the
|
|
|
|
client.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
enableSnippets = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Whether to include code snippets (such as class, stful, switch) in code completion. When
|
|
|
|
unspecified, snippets will be included.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
updateImportsOnRename = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Whether to update imports and other directives when files are renamed. When unspecified,
|
|
|
|
imports will be updated if the client supports willRenameFiles requests
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
documentation = mkOption {
|
|
|
|
type = types.nullOr (types.enum [ "none" "summary" "full" ]);
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
The typekind of dartdocs to include in Hovers, Code Completion, Signature Help and other
|
|
|
|
similar requests. If not set, defaults to full
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
includeDependenciesInWorkspaceSymbols = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
2023-01-21 18:12:09 +01:00
|
|
|
Whether to include symbols from dependencies and Dart/Flutter SDKs in Workspace Symbol
|
2023-01-10 23:47:52 +01:00
|
|
|
results. If not set, defaults to true.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
settings = cfg: { dart = cfg; };
|
|
|
|
}
|
2022-11-16 13:37:35 +01:00
|
|
|
{
|
|
|
|
name = "denols";
|
|
|
|
description = "Enable denols, for Deno";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.deno;
|
2022-11-16 13:37:35 +01:00
|
|
|
}
|
2022-07-28 21:37:49 +02:00
|
|
|
{
|
|
|
|
name = "eslint";
|
|
|
|
description = "Enable eslint";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.vscode-langservers-extracted;
|
2023-02-14 20:40:59 +01:00
|
|
|
cmd = cfg: [ "${cfg.package}/bin/vscode-eslint-language-server" "--stdio" ];
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
2022-10-22 14:55:22 +01:00
|
|
|
{
|
|
|
|
name = "elixirls";
|
|
|
|
description = "Enable elixirls";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.elixir_ls;
|
2023-01-19 16:02:40 +00:00
|
|
|
cmd = cfg: [ "${cfg.package}/bin/elixir-ls" ];
|
2022-10-22 14:55:22 +01:00
|
|
|
}
|
2022-07-28 21:37:49 +02:00
|
|
|
{
|
|
|
|
name = "gdscript";
|
|
|
|
description = "Enable gdscript, for Godot";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = null;
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "gopls";
|
|
|
|
description = "Enable gopls, for Go.";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "html";
|
|
|
|
description = "Enable html, for HTML";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.vscode-langservers-extracted;
|
|
|
|
cmd = cfg: [ "${cfg.package}/bin/vscode-html-language-server" "--stdio" ];
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "jsonls";
|
|
|
|
description = "Enable jsonls, for JSON";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.vscode-langservers-extracted;
|
|
|
|
cmd = cfg: [ "${cfg.package}/bin/vscode-json-language-server" "--stdio" ];
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
2023-01-10 23:47:52 +01:00
|
|
|
{
|
|
|
|
name = "nil_ls";
|
|
|
|
description = "Enable nil, for Nix";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nil;
|
2023-01-23 14:52:46 +01:00
|
|
|
settingsOptions = {
|
2023-01-10 23:47:52 +01:00
|
|
|
formatting.command = mkOption {
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
External formatter command (with arguments).
|
|
|
|
It should accepts file content in stdin and print the formatted code into stdout.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
diagnostics = {
|
|
|
|
ignored = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ ];
|
|
|
|
description = ''
|
|
|
|
Ignored diagnostic kinds.
|
|
|
|
The kind identifier is a snake_cased_string usually shown together
|
|
|
|
with the diagnostic message.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
excludedFiles = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ ];
|
|
|
|
description = ''
|
|
|
|
Files to exclude from showing diagnostics. Useful for generated files.
|
|
|
|
It accepts an array of paths. Relative paths are joint to the workspace root.
|
|
|
|
Glob patterns are currently not supported.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
settings = cfg: { nil = { inherit (cfg) formatting diagnostics; }; };
|
|
|
|
}
|
2022-07-28 21:37:49 +02:00
|
|
|
{
|
|
|
|
name = "pyright";
|
|
|
|
description = "Enable pyright, for Python.";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "rnix-lsp";
|
|
|
|
description = "Enable rnix LSP, for Nix";
|
|
|
|
serverName = "rnix";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "rust-analyzer";
|
|
|
|
description = "Enable rust-analyzer, for Rust.";
|
|
|
|
serverName = "rust_analyzer";
|
2023-01-21 18:15:46 +01:00
|
|
|
|
2023-01-23 14:52:46 +01:00
|
|
|
settingsOptions = import ./rust-analyzer-config.nix lib;
|
2023-01-21 18:15:46 +01:00
|
|
|
settings = cfg: { rust-analyzer = cfg; };
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
2023-01-19 11:37:36 +01:00
|
|
|
{
|
|
|
|
name = "sumneko-lua";
|
|
|
|
description = "Enable sumneko_lua, for lua";
|
2023-01-19 16:02:40 +00:00
|
|
|
package = pkgs.sumneko-lua-language-server;
|
2023-01-19 11:37:36 +01:00
|
|
|
serverName = "sumneko_lua";
|
|
|
|
}
|
2022-12-15 18:03:31 +01:00
|
|
|
{
|
|
|
|
name = "tailwindcss";
|
|
|
|
description = "Enable tailwindcss language server, for tailwindcss";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages."@tailwindcss/language-server";
|
2022-12-15 18:03:31 +01:00
|
|
|
}
|
2023-01-10 13:42:22 +01:00
|
|
|
{
|
|
|
|
name = "texlab";
|
|
|
|
description = "Enable texlab language server, for LaTeX";
|
|
|
|
}
|
2022-10-28 01:40:40 +02:00
|
|
|
{
|
|
|
|
name = "tsserver";
|
|
|
|
description = "Enable tsserver for typescript";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.typescript-language-server;
|
2022-10-28 01:40:40 +02:00
|
|
|
}
|
2022-07-28 21:37:49 +02:00
|
|
|
{
|
|
|
|
name = "vuels";
|
|
|
|
description = "Enable vuels, for Vue";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.nodePackages.vue-language-server;
|
2022-07-28 21:37:49 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "zls";
|
|
|
|
description = "Enable zls, for Zig.";
|
|
|
|
}
|
2022-12-01 14:05:35 +00:00
|
|
|
{
|
|
|
|
name = "hls";
|
|
|
|
description = "Enable haskell language server";
|
2023-01-19 10:36:56 +00:00
|
|
|
package = pkgs.haskell-language-server;
|
|
|
|
cmd = cfg: [ "haskell-language-server-wrapper" ];
|
2022-12-01 14:05:35 +00:00
|
|
|
}
|
2022-07-28 21:37:49 +02:00
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = lib.lists.map (helpers.mkLsp) servers;
|
|
|
|
}
|