mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 10:44:34 +02:00
plugins/lsp/volar: add ts-ls integration
This commit is contained in:
parent
384f97cf50
commit
a8ab73432a
2 changed files with 89 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
empty = {
|
||||
plugins.lsp.enable = true;
|
||||
|
@ -222,4 +222,66 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
volar-tsls-integration =
|
||||
{ config, ... }:
|
||||
{
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
volar.enable = true;
|
||||
ts-ls = {
|
||||
enable = true;
|
||||
filetypes = [ "typescript" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.any (x: x == "vue") config.plugins.lsp.servers.ts-ls.filetypes;
|
||||
message = "Expected `vue` filetype configuration.";
|
||||
}
|
||||
{
|
||||
assertion = lib.any (
|
||||
x: x.name == "@vue/typescript-plugin"
|
||||
) config.plugins.lsp.servers.ts-ls.extraOptions.init_options.plugins;
|
||||
message = "Expected `@vue/typescript-plugin` plugin.";
|
||||
}
|
||||
{
|
||||
assertion = lib.any (x: x == "typescript") config.plugins.lsp.servers.ts-ls.filetypes;
|
||||
message = "Expected `typescript` filetype configuration.";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
tsls-filetypes =
|
||||
{ config, ... }:
|
||||
{
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
ts-ls = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.all (x: x != "vue") config.plugins.lsp.servers.ts-ls.filetypes;
|
||||
message = "Did not expect `vue` filetype configuration.";
|
||||
}
|
||||
(lib.mkIf (config.plugins.lsp.servers.ts-ls.extraOptions ? init_options) {
|
||||
assertion = lib.all (
|
||||
x: x.name != "@vue/typescript-plugin"
|
||||
) config.plugins.lsp.servers.ts-ls.extraOptions.init_options.plugins;
|
||||
message = "Did not expect `@vue/typescript-plugin` plugin.";
|
||||
})
|
||||
{
|
||||
assertion = lib.any (x: x == "typescript") config.plugins.lsp.servers.ts-ls.filetypes;
|
||||
message = "Expected `typescript` filetype configuration.";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue