From 1ed6fd9f58f4df669edc55284becd1a90e1b3a47 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 4 May 2025 17:58:22 +0300 Subject: [PATCH] languages: deprecate `vim.languages.enableLSP` This change is done in favor of our intentions to use the new API Neovim has exposed, and the one we are exposing to match theirs. --- configuration.nix | 7 ++- flake/templates/standalone/flake.nix | 12 ++++- modules/neovim/init/lsp.nix | 65 +++++++++++++++---------- modules/plugins/languages/asm.nix | 2 +- modules/plugins/languages/astro.nix | 2 +- modules/plugins/languages/bash.nix | 2 +- modules/plugins/languages/clang.nix | 2 +- modules/plugins/languages/csharp.nix | 2 +- modules/plugins/languages/css.nix | 2 +- modules/plugins/languages/cue.nix | 2 +- modules/plugins/languages/dart.nix | 2 +- modules/plugins/languages/default.nix | 14 ++---- modules/plugins/languages/elixir.nix | 2 +- modules/plugins/languages/fsharp.nix | 2 +- modules/plugins/languages/gleam.nix | 2 +- modules/plugins/languages/go.nix | 2 +- modules/plugins/languages/haskell.nix | 2 +- modules/plugins/languages/hcl.nix | 2 +- modules/plugins/languages/helm.nix | 2 +- modules/plugins/languages/java.nix | 2 +- modules/plugins/languages/julia.nix | 2 +- modules/plugins/languages/kotlin.nix | 2 +- modules/plugins/languages/lua.nix | 2 +- modules/plugins/languages/markdown.nix | 2 +- modules/plugins/languages/nim.nix | 2 +- modules/plugins/languages/nix.nix | 2 +- modules/plugins/languages/nu.nix | 2 +- modules/plugins/languages/ocaml.nix | 2 +- modules/plugins/languages/odin.nix | 2 +- modules/plugins/languages/php.nix | 2 +- modules/plugins/languages/python.nix | 2 +- modules/plugins/languages/r.nix | 2 +- modules/plugins/languages/ruby.nix | 2 +- modules/plugins/languages/rust.nix | 2 +- modules/plugins/languages/scala.nix | 2 +- modules/plugins/languages/sql.nix | 2 +- modules/plugins/languages/svelte.nix | 2 +- modules/plugins/languages/tailwind.nix | 2 +- modules/plugins/languages/terraform.nix | 2 +- modules/plugins/languages/ts.nix | 2 +- modules/plugins/languages/typst.nix | 2 +- modules/plugins/languages/vala.nix | 2 +- modules/plugins/languages/wgsl.nix | 2 +- modules/plugins/languages/yaml.nix | 2 +- modules/plugins/languages/zig.nix | 2 +- modules/plugins/lsp/module.nix | 3 +- 46 files changed, 102 insertions(+), 81 deletions(-) diff --git a/configuration.nix b/configuration.nix index 6629810d..6e3175ef 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,6 +18,10 @@ isMaximal: { }; lsp = { + # This must be enabled for the language modules to hook into + # the LSP API. + enable = true; + formatOnSave = true; lspkind.enable = false; lightbulb.enable = true; @@ -38,8 +42,7 @@ isMaximal: { # This section does not include a comprehensive list of available language modules. # To list all available language module options, please visit the nvf manual. languages = { - enableLSP = true; - enableFormat = true; + enableFormat = true; # enableTreesitter = true; enableExtraDiagnostics = true; diff --git a/flake/templates/standalone/flake.nix b/flake/templates/standalone/flake.nix index 79617260..1057a6d5 100644 --- a/flake/templates/standalone/flake.nix +++ b/flake/templates/standalone/flake.nix @@ -26,12 +26,22 @@ config.vim = { theme.enable = true; + lsp = { + # Enable LSP functionality globally. This is required for modules found + # in `vim.languages` to enable relevant LSPs. + enable = true; + + # You may define your own LSP configurations using `vim.lsp.servers` in + # nvf without ever needing lspconfig to do it. This will use the native + # API provided by Neovim > 0.11 + servers = {}; + }; + # Language support and automatic configuration of companion plugins. # Note that enabling, e.g., languages..diagnostics will automatically # enable top-level options such as enableLSP or enableExtraDiagnostics as # they are needed. languages = { - enableLSP = true; enableFormat = true; enableTreesitter = true; enableExtraDiagnostics = true; diff --git a/modules/neovim/init/lsp.nix b/modules/neovim/init/lsp.nix index faef0f93..b89c3fde 100644 --- a/modules/neovim/init/lsp.nix +++ b/modules/neovim/init/lsp.nix @@ -5,7 +5,7 @@ }: let inherit (builtins) filter; inherit (lib.modules) mkIf mkMerge mkDefault; - inherit (lib.options) mkOption; + inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) attrsOf; inherit (lib.strings) concatLines; inherit (lib.attrsets) mapAttrsToList attrNames filterAttrs; @@ -27,37 +27,48 @@ enabledServers = filterAttrs (_: u: u.enable) cfg.servers; in { options = { - vim.lsp.servers = mkOption { - type = attrsOf lspOptions; - default = {}; - example = '' - { - "*" = { - root_markers = [".git"]; - capabilities = { - textDocument = { - semanticTokens = { - multilineTokenSupport = true; + vim.lsp = { + enable = mkEnableOption '' + global LSP functionality for Neovim. + + This option controls whether to enable LSP functionality within modules under + {option}`vim.languages`. You do not need to set this to `true` for language + servers defined in {option}`vim.lsp.servers` to take effect, since they are + enabled automatically. + ''; + + servers = mkOption { + type = attrsOf lspOptions; + default = {}; + example = '' + { + "*" = { + root_markers = [".git"]; + capabilities = { + textDocument = { + semanticTokens = { + multilineTokenSupport = true; + }; }; }; }; - }; - "clangd" = { - filetypes = ["c"]; - }; - } - ''; - description = '' - LSP configurations that will be managed using `vim.lsp.config()` and - related utilities added in Neovim 0.11. LSPs defined here will be - added to the resulting {file}`init.lua` using `vim.lsp.config` and - enabled through `vim.lsp.enable` below the configuration table. + "clangd" = { + filetypes = ["c"]; + }; + } + ''; + description = '' + LSP configurations that will be managed using `vim.lsp.config()` and related + utilities added in Neovim 0.11. LSPs defined here will be added to the + resulting {file}`init.lua` using `vim.lsp.config` and enabled through + `vim.lsp.enable()` API from Neovim below the configuration table. - You may review the generated configuration by running {command}`nvf-print-config` - in a shell. Please see {command}`:help lsp-config` for more details - on the underlying API. - ''; + You may review the generated configuration by running {command}`nvf-print-config` + in a shell. Please see {command}`:help lsp-config` for more details + on the underlying API. + ''; + }; }; }; diff --git a/modules/plugins/languages/asm.nix b/modules/plugins/languages/asm.nix index a0e96cef..9fe58a76 100644 --- a/modules/plugins/languages/asm.nix +++ b/modules/plugins/languages/asm.nix @@ -20,7 +20,7 @@ in { }; lsp = { - enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.lsp.enable;}; package = mkOption { type = package; diff --git a/modules/plugins/languages/astro.nix b/modules/plugins/languages/astro.nix index 2ecbbe47..b7a69bda 100644 --- a/modules/plugins/languages/astro.nix +++ b/modules/plugins/languages/astro.nix @@ -81,7 +81,7 @@ in { }; lsp = { - enable = mkEnableOption "Astro LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Astro LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/bash.nix b/modules/plugins/languages/bash.nix index bfe01032..e02596cf 100644 --- a/modules/plugins/languages/bash.nix +++ b/modules/plugins/languages/bash.nix @@ -56,7 +56,7 @@ in { }; lsp = { - enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Bash LSP server to use"; diff --git a/modules/plugins/languages/clang.nix b/modules/plugins/languages/clang.nix index bb30cc95..2db178e9 100644 --- a/modules/plugins/languages/clang.nix +++ b/modules/plugins/languages/clang.nix @@ -98,7 +98,7 @@ in { }; lsp = { - enable = mkEnableOption "clang LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "clang LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "The clang LSP server to use"; diff --git a/modules/plugins/languages/csharp.nix b/modules/plugins/languages/csharp.nix index af7f36e0..49ae4985 100644 --- a/modules/plugins/languages/csharp.nix +++ b/modules/plugins/languages/csharp.nix @@ -91,7 +91,7 @@ in { }; lsp = { - enable = mkEnableOption "C# LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "C# LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "C# LSP server to use"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/css.nix b/modules/plugins/languages/css.nix index d103f241..0147fba3 100644 --- a/modules/plugins/languages/css.nix +++ b/modules/plugins/languages/css.nix @@ -80,7 +80,7 @@ in { }; lsp = { - enable = mkEnableOption "CSS LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "CSS LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "CSS LSP server to use"; diff --git a/modules/plugins/languages/cue.nix b/modules/plugins/languages/cue.nix index 313e3233..bd446cbf 100644 --- a/modules/plugins/languages/cue.nix +++ b/modules/plugins/languages/cue.nix @@ -21,7 +21,7 @@ in { }; lsp = { - enable = mkEnableOption "CUE LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "CUE LSP support" // {default = config.vim.lsp.enable;}; package = mkOption { type = package; diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index 7b9584b9..9cbd0783 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -77,7 +77,7 @@ in { flutter-tools = { enable = mkOption { type = bool; - default = config.vim.languages.enableLSP; + default = config.vim.lsp.enable; description = "Enable flutter-tools for flutter support"; }; diff --git a/modules/plugins/languages/default.nix b/modules/plugins/languages/default.nix index b889e60a..25b99080 100644 --- a/modules/plugins/languages/default.nix +++ b/modules/plugins/languages/default.nix @@ -1,8 +1,5 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let + inherit (lib.modules) mkRenamedOptionModule; inherit (lib.nvim.languages) mkEnable; in { imports = [ @@ -48,13 +45,12 @@ in { ./wgsl.nix ./yaml.nix ./ruby.nix + + # This is now a hard deprecation. + (mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"]) ]; options.vim.languages = { - # LSPs are now built into Neovim, and we should enable them by default - # if `vim.lsp.enable` is true. - enableLSP = mkEnable "LSP" // {default = config.vim.lsp.enable;}; - # Those are still managed by plugins, and should be enabled here. enableDAP = mkEnable "Debug Adapter"; enableTreesitter = mkEnable "Treesitter"; diff --git a/modules/plugins/languages/elixir.nix b/modules/plugins/languages/elixir.nix index 7b3a0256..241efd8e 100644 --- a/modules/plugins/languages/elixir.nix +++ b/modules/plugins/languages/elixir.nix @@ -53,7 +53,7 @@ in { }; lsp = { - enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Elixir LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Elixir LSP server to use"; diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix index 966b0349..6ed0ccab 100644 --- a/modules/plugins/languages/fsharp.nix +++ b/modules/plugins/languages/fsharp.nix @@ -51,7 +51,7 @@ in { }; lsp = { - enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "F# LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); default = defaultServer; diff --git a/modules/plugins/languages/gleam.nix b/modules/plugins/languages/gleam.nix index 284d3443..272ef51e 100644 --- a/modules/plugins/languages/gleam.nix +++ b/modules/plugins/languages/gleam.nix @@ -41,7 +41,7 @@ in { }; lsp = { - enable = mkEnableOption "Gleam LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Gleam LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/go.nix b/modules/plugins/languages/go.nix index 3f232669..bab0ff4a 100644 --- a/modules/plugins/languages/go.nix +++ b/modules/plugins/languages/go.nix @@ -67,7 +67,7 @@ in { }; lsp = { - enable = mkEnableOption "Go LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Go LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Go LSP server to use"; diff --git a/modules/plugins/languages/haskell.nix b/modules/plugins/languages/haskell.nix index ff6c7d78..f50c9f09 100644 --- a/modules/plugins/languages/haskell.nix +++ b/modules/plugins/languages/haskell.nix @@ -25,7 +25,7 @@ in { }; lsp = { - enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.lsp.enable;}; package = mkOption { description = "Haskell LSP package or command to run the Haskell LSP"; example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]''; diff --git a/modules/plugins/languages/hcl.nix b/modules/plugins/languages/hcl.nix index 3a3db782..e702170c 100644 --- a/modules/plugins/languages/hcl.nix +++ b/modules/plugins/languages/hcl.nix @@ -43,7 +43,7 @@ in { }; lsp = { - enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.lsp.enable;}; # TODO: (maybe, is it better?) it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard package = mkOption { type = package; diff --git a/modules/plugins/languages/helm.nix b/modules/plugins/languages/helm.nix index d3fd636e..ffe115c9 100644 --- a/modules/plugins/languages/helm.nix +++ b/modules/plugins/languages/helm.nix @@ -54,7 +54,7 @@ in { }; lsp = { - enable = mkEnableOption "Helm LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Helm LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Helm LSP server to use"; diff --git a/modules/plugins/languages/java.nix b/modules/plugins/languages/java.nix index dc46fcfe..2e26feea 100644 --- a/modules/plugins/languages/java.nix +++ b/modules/plugins/languages/java.nix @@ -23,7 +23,7 @@ in { }; lsp = { - enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.lsp.enable;}; package = mkOption { description = "java language server package, or the command to run as a list of strings"; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; diff --git a/modules/plugins/languages/julia.nix b/modules/plugins/languages/julia.nix index aa537df9..8c48b070 100644 --- a/modules/plugins/languages/julia.nix +++ b/modules/plugins/languages/julia.nix @@ -78,7 +78,7 @@ in { lsp = { enable = mkOption { type = bool; - default = config.vim.languages.enableLSP; + default = config.vim.lsp.enable; description = '' Whether to enable Julia LSP support. diff --git a/modules/plugins/languages/kotlin.nix b/modules/plugins/languages/kotlin.nix index 2ddc63e9..1118afdf 100644 --- a/modules/plugins/languages/kotlin.nix +++ b/modules/plugins/languages/kotlin.nix @@ -30,7 +30,7 @@ in { }; lsp = { - enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.lsp.enable;}; package = mkOption { description = "kotlin_language_server package with Kotlin runtime"; diff --git a/modules/plugins/languages/lua.nix b/modules/plugins/languages/lua.nix index d5be4905..9f56cbea 100644 --- a/modules/plugins/languages/lua.nix +++ b/modules/plugins/languages/lua.nix @@ -43,7 +43,7 @@ in { }; lsp = { - enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.lsp.enable;}; package = mkOption { description = "LuaLS package, or the command to run as a list of strings"; diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index 4563bc44..eeb80e8d 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -67,7 +67,7 @@ in { }; lsp = { - enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/nim.nix b/modules/plugins/languages/nim.nix index 69288223..d9a29e37 100644 --- a/modules/plugins/languages/nim.nix +++ b/modules/plugins/languages/nim.nix @@ -54,7 +54,7 @@ in { }; lsp = { - enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Nim LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Nim LSP server to use"; type = str; diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index ad16a34e..83022adf 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -143,7 +143,7 @@ in { }; lsp = { - enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Nix LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Nix LSP server to use"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/nu.nix b/modules/plugins/languages/nu.nix index eab0385c..bd007fc8 100644 --- a/modules/plugins/languages/nu.nix +++ b/modules/plugins/languages/nu.nix @@ -40,7 +40,7 @@ in { }; lsp = { - enable = mkEnableOption "Nu LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Nu LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = str; default = defaultServer; diff --git a/modules/plugins/languages/ocaml.nix b/modules/plugins/languages/ocaml.nix index 568b846e..995ca04d 100644 --- a/modules/plugins/languages/ocaml.nix +++ b/modules/plugins/languages/ocaml.nix @@ -49,7 +49,7 @@ in { }; lsp = { - enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.lsp.enable;}; server = mkOption { description = "OCaml LSP server to user"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/odin.nix b/modules/plugins/languages/odin.nix index 7a32db93..6d20351c 100644 --- a/modules/plugins/languages/odin.nix +++ b/modules/plugins/languages/odin.nix @@ -41,7 +41,7 @@ in { }; lsp = { - enable = mkEnableOption "Odin LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Odin LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/php.nix b/modules/plugins/languages/php.nix index 4dccc8cd..61ff0425 100644 --- a/modules/plugins/languages/php.nix +++ b/modules/plugins/languages/php.nix @@ -95,7 +95,7 @@ in { }; lsp = { - enable = mkEnableOption "PHP LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "PHP LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "PHP LSP server to use"; diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 9905716e..bec7ec8b 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -169,7 +169,7 @@ in { }; lsp = { - enable = mkEnableOption "Python LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Python LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Python LSP server to use"; diff --git a/modules/plugins/languages/r.nix b/modules/plugins/languages/r.nix index fcadcc37..894c63f6 100644 --- a/modules/plugins/languages/r.nix +++ b/modules/plugins/languages/r.nix @@ -79,7 +79,7 @@ in { }; lsp = { - enable = mkEnableOption "R LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "R LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "R LSP server to use"; diff --git a/modules/plugins/languages/ruby.nix b/modules/plugins/languages/ruby.nix index 2f42aa4f..ab0e0905 100644 --- a/modules/plugins/languages/ruby.nix +++ b/modules/plugins/languages/ruby.nix @@ -57,7 +57,7 @@ in { }; lsp = { - enable = mkEnableOption "Ruby LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Ruby LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index 2181623a..677f7d3b 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -43,7 +43,7 @@ in { }; lsp = { - enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.lsp.enable;}; package = mkOption { description = "rust-analyzer package, or the command to run as a list of strings"; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; diff --git a/modules/plugins/languages/scala.nix b/modules/plugins/languages/scala.nix index f769d092..b5382415 100644 --- a/modules/plugins/languages/scala.nix +++ b/modules/plugins/languages/scala.nix @@ -33,7 +33,7 @@ in { }; lsp = { - enable = mkEnableOption "Scala LSP support (metals)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Scala LSP support (metals)" // {default = config.vim.lsp.enable;}; package = mkPackageOption pkgs "metals" { default = ["metals"]; }; diff --git a/modules/plugins/languages/sql.nix b/modules/plugins/languages/sql.nix index 277dbeef..add46c15 100644 --- a/modules/plugins/languages/sql.nix +++ b/modules/plugins/languages/sql.nix @@ -79,7 +79,7 @@ in { }; lsp = { - enable = mkEnableOption "SQL LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "SQL LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "SQL LSP server to use"; diff --git a/modules/plugins/languages/svelte.nix b/modules/plugins/languages/svelte.nix index 536ff2c1..08a807c7 100644 --- a/modules/plugins/languages/svelte.nix +++ b/modules/plugins/languages/svelte.nix @@ -77,7 +77,7 @@ in { }; lsp = { - enable = mkEnableOption "Svelte LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Svelte LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Svelte LSP server to use"; diff --git a/modules/plugins/languages/tailwind.nix b/modules/plugins/languages/tailwind.nix index 594f6d9d..fbe707ba 100644 --- a/modules/plugins/languages/tailwind.nix +++ b/modules/plugins/languages/tailwind.nix @@ -35,7 +35,7 @@ in { enable = mkEnableOption "Tailwindcss language support"; lsp = { - enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Tailwindcss LSP server to use"; diff --git a/modules/plugins/languages/terraform.nix b/modules/plugins/languages/terraform.nix index 33bb9357..095da072 100644 --- a/modules/plugins/languages/terraform.nix +++ b/modules/plugins/languages/terraform.nix @@ -20,7 +20,7 @@ in { }; lsp = { - enable = mkEnableOption "Terraform LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Terraform LSP support (terraform-ls)" // {default = config.vim.lsp.enable;}; package = mkOption { description = "terraform-ls package"; diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index df1353ab..5a1e5889 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -120,7 +120,7 @@ in { }; lsp = { - enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Typescript/Javascript LSP server to use"; diff --git a/modules/plugins/languages/typst.nix b/modules/plugins/languages/typst.nix index 8c65ae2c..08a2252b 100644 --- a/modules/plugins/languages/typst.nix +++ b/modules/plugins/languages/typst.nix @@ -76,7 +76,7 @@ in { }; lsp = { - enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Typst LSP server to use"; diff --git a/modules/plugins/languages/vala.nix b/modules/plugins/languages/vala.nix index da65a372..220926d0 100644 --- a/modules/plugins/languages/vala.nix +++ b/modules/plugins/languages/vala.nix @@ -50,7 +50,7 @@ in { }; lsp = { - enable = mkEnableOption "Vala LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Vala LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { description = "Vala LSP server to use"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/wgsl.nix b/modules/plugins/languages/wgsl.nix index 7c8a1016..f374543e 100644 --- a/modules/plugins/languages/wgsl.nix +++ b/modules/plugins/languages/wgsl.nix @@ -42,7 +42,7 @@ in { }; lsp = { - enable = mkEnableOption "WGSL LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "WGSL LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/yaml.nix b/modules/plugins/languages/yaml.nix index c84b17cd..7a1a4552 100644 --- a/modules/plugins/languages/yaml.nix +++ b/modules/plugins/languages/yaml.nix @@ -55,7 +55,7 @@ in { }; lsp = { - enable = mkEnableOption "YAML LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "YAML LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/zig.nix b/modules/plugins/languages/zig.nix index 2aa0e2b6..89307eab 100644 --- a/modules/plugins/languages/zig.nix +++ b/modules/plugins/languages/zig.nix @@ -72,7 +72,7 @@ in { }; lsp = { - enable = mkEnableOption "Zig LSP support" // {default = config.vim.languages.enableLSP;}; + enable = mkEnableOption "Zig LSP support" // {default = config.vim.lsp.enable;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/lsp/module.nix b/modules/plugins/lsp/module.nix index f408d873..6b63d725 100644 --- a/modules/plugins/lsp/module.nix +++ b/modules/plugins/lsp/module.nix @@ -3,11 +3,12 @@ inherit (lib.nvim.binds) mkMappingOption; in { options.vim.lsp = { - enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; formatOnSave = mkEnableOption "format on save"; + inlayHints = { enable = mkEnableOption "inlay hints"; }; + mappings = { goToDefinition = mkMappingOption "Go to definition"