modules/lsp: enable servers."*" by default

This commit is contained in:
Matt Sturgeon 2025-04-30 22:47:51 +01:00
parent b6e2016b7f
commit a072e3c3a7
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 17 additions and 15 deletions

View file

@ -93,6 +93,8 @@ in
type = types.submodule ( type = types.submodule (
lib.modules.importApply ./server-base.nix { lib.modules.importApply ./server-base.nix {
displayName = "all servers"; displayName = "all servers";
enable.name = "the `*` server config";
enable.default = true;
settings.extraDescription = '' settings.extraDescription = ''
Will be merged by neovim using the behaviour of [`vim.tbl_deep_extend()`](https://neovim.io/doc/user/lua.html#vim.tbl_deep_extend()). Will be merged by neovim using the behaviour of [`vim.tbl_deep_extend()`](https://neovim.io/doc/user/lua.html#vim.tbl_deep_extend()).
''; '';
@ -123,13 +125,10 @@ in
''; '';
default = { }; default = { };
example = { example = {
"*" = { "*".settings = {
enable = true; root_markers = [ ".git" ];
settings = { capabilities.textDocument.semanticTokens = {
root_markers = [ ".git" ]; multilineTokenSupport = true;
capabilities.textDocument.semanticTokens = {
multilineTokenSupport = true;
};
}; };
}; };
luals.enable = true; luals.enable = true;

View file

@ -2,6 +2,7 @@
{ {
displayName ? "the language server", displayName ? "the language server",
settings ? null, settings ? null,
enable ? null,
}: }:
{ lib, ... }: { lib, ... }:
let let
@ -9,7 +10,12 @@ let
in in
{ {
options = { options = {
enable = lib.mkEnableOption displayName; enable = lib.mkOption rec {
type = types.bool;
description = "Whether to enable ${enable.name or displayName}. ${enable.extraDescription or ""}";
default = enable.default or false;
example = enable.example or (!default);
};
settings = lib.mkOption { settings = lib.mkOption {
type = with types; attrsOf anything; type = with types; attrsOf anything;

View file

@ -1,14 +1,11 @@
{ {
example = { example = {
lsp.servers = { lsp.servers = {
"*" = { "*".settings = {
enable = true; enable = true;
settings = { root_markers = [ ".git" ];
enable = true; capabilities.textDocument.semanticTokens = {
root_markers = [ ".git" ]; multilineTokenSupport = true;
capabilities.textDocument.semanticTokens = {
multilineTokenSupport = true;
};
}; };
}; };
luals.enable = true; luals.enable = true;