From 438ea0939e468835cb6f64a390c64222c85fd848 Mon Sep 17 00:00:00 2001 From: Soliprem Date: Sun, 3 Nov 2024 12:49:15 +0100 Subject: [PATCH] vala: applying reviews --- modules/plugins/languages/vala.nix | 9 ++++----- .../plugins/utility/preview/markdown-preview/config.nix | 7 +++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/plugins/languages/vala.nix b/modules/plugins/languages/vala.nix index efec6eb..58955fa 100644 --- a/modules/plugins/languages/vala.nix +++ b/modules/plugins/languages/vala.nix @@ -20,6 +20,8 @@ servers = { vala_ls = { package = pkgs.vala-language-server; + runtimeInputs = pkgs.uncrustify; + internalFormatter = true; lspConfig = '' lspconfig.vala_ls.setup { capabilities = capabilities; @@ -41,7 +43,7 @@ nullConfig = pkg: '' table.insert( ls_sources, - null_ls.builtins.diagnostics.eslint_d.with({ + null_ls.builtins.diagnostics.vala_lint.with({ command = "${getExe pkg}", }) ) @@ -54,13 +56,11 @@ in { treesitter = { enable = mkEnableOption "Vala treesitter" // {default = config.vim.languages.enableTreesitter;}; - package = mkGrammarOption pkgs "vala"; }; lsp = { enable = mkEnableOption "Vala LSP support" // {default = config.vim.languages.enableLSP;}; - server = mkOption { description = "Vala LSP server to use"; type = enum (attrNames servers); @@ -69,7 +69,7 @@ in { package = mkOption { description = "Vala LSP server package, or the command to run as a list of strings"; - example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]''; + example = ''[lib.getExe pkgs.vala-language-server]''; type = either package (listOf str); default = servers.${cfg.lsp.server}.package; }; @@ -77,7 +77,6 @@ in { extraDiagnostics = { enable = mkEnableOption "extra Vala diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; - types = diagnostics { langDesc = "Vala"; inherit diagnosticsProviders; diff --git a/modules/plugins/utility/preview/markdown-preview/config.nix b/modules/plugins/utility/preview/markdown-preview/config.nix index 635a8a4..8349d3f 100644 --- a/modules/plugins/utility/preview/markdown-preview/config.nix +++ b/modules/plugins/utility/preview/markdown-preview/config.nix @@ -4,9 +4,8 @@ lib, ... }: let - inherit (lib.strings) stringLength concatMapStringsSep; + inherit (lib.strings) concatMapStringsSep; inherit (lib.modules) mkIf; - cfg = config.vim.utility.preview.markdownPreview; in { config = mkIf cfg.enable { @@ -19,8 +18,8 @@ in { mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)]; mkdp_command_for_global = cfg.alwaysAllowPreview; mkdp_open_to_the_world = cfg.broadcastServer; - mkdp_open_ip = mkIf (stringLength cfg.customIP > 0) cfg.customIP; - mkdp_port = mkIf (stringLength cfg.customPort > 0) cfg.customPort; + mkdp_open_ip = cfg.customIP; + mkdp_port = cfg.customPort; }; }; }