mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-05 18:01:32 +00:00
lib/languages: add explicit enable to LSP submodule
This commit is contained in:
parent
35c432db3b
commit
52fb95ea6b
1 changed files with 18 additions and 9 deletions
|
@ -1,11 +1,11 @@
|
|||
{lib}: let
|
||||
inherit (builtins) isString getAttr;
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.types) listOf bool str submodule attrsOf anything;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) luaInline;
|
||||
in {
|
||||
# TODO: remove
|
||||
diagnosticsToLua = {
|
||||
lang,
|
||||
config,
|
||||
|
@ -37,30 +37,39 @@ in {
|
|||
lspOptions = submodule {
|
||||
freeformType = attrsOf anything;
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to enable this LSP server.";
|
||||
};
|
||||
|
||||
capabilities = mkOption {
|
||||
type = luaInline;
|
||||
default = mkLuaInline "capabilities";
|
||||
type = nullOr (either luaInline (attrsOf anything));
|
||||
default = null;
|
||||
description = "LSP capabilitiess to pass to lspconfig";
|
||||
};
|
||||
|
||||
on_attach = mkOption {
|
||||
type = luaInline;
|
||||
default = mkLuaInline "default_on_attach";
|
||||
type = nullOr luaInline;
|
||||
default = null;
|
||||
description = "Function to execute when an LSP server attaches to a buffer";
|
||||
};
|
||||
|
||||
filetypes = mkOption {
|
||||
type = listOf str;
|
||||
type = nullOr (listOf str);
|
||||
default = null;
|
||||
description = "Filetypes to auto-attach LSP in";
|
||||
};
|
||||
|
||||
cmd = mkOption {
|
||||
type = listOf str;
|
||||
type = nullOr (listOf str);
|
||||
default = null;
|
||||
description = "Command used to start the LSP server";
|
||||
};
|
||||
|
||||
root_markers = mkOption {
|
||||
type = listOf str;
|
||||
type = nullOr (listOf str);
|
||||
default = null;
|
||||
description = ''
|
||||
"root markers" used to determine the root directory of the workspace, and
|
||||
the filetypes associated with this LSP server.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue