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:
parent
4c99ccfe1e
commit
96c9775a5f
1 changed files with 6 additions and 2 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue