1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

plugins/lsp/volar: handle null package with ts_ls integration

The ts_ls integration needs to call `getBin cfg.package`, so the package
cannot be null.

Adds an assertion.
This commit is contained in:
Matt Sturgeon 2025-10-03 18:56:36 +01:00
parent 4c99ccfe1e
commit 96c9775a5f

View file

@ -162,12 +162,16 @@ let
example = false;
};
};
extraConfig = cfg: {
extraConfig = cfg: opts: {
assertions = lib.nixvim.mkAssertions "plugins.lsp.servers.volar" {
assertion = cfg.tslsIntegration -> (cfg.package != null);
message = "When `${opts.tslsIntegration}` is enabled, `${opts.package}` must not be null.";
};
plugins.lsp.servers.ts_ls = lib.mkIf (cfg.enable && cfg.tslsIntegration) {
filetypes = [ "vue" ];
extraOptions = {
init_options = {
plugins = [
plugins = lib.mkIf (cfg.package != null) [
{
name = "@vue/typescript-plugin";
location = "${lib.getBin cfg.package}/lib/language-tools/packages/language-server";