plugins/lsp/volar: add ts-ls integration

This commit is contained in:
Austin Horstman 2024-09-20 20:40:56 -05:00
parent 384f97cf50
commit a8ab73432a
No known key found for this signature in database
2 changed files with 89 additions and 1 deletions

View file

@ -691,6 +691,32 @@ let
"nodePackages"
"@volar/vue-language-server"
];
extraOptions = {
tslsIntegration = mkOption {
type = types.bool;
description = ''
Enable integration with TypeScript language server.
'';
default = true;
example = false;
};
};
extraConfig = cfg: {
plugins.lsp.servers.ts-ls = lib.mkIf (cfg.enable && cfg.tslsIntegration) {
filetypes = [ "vue" ];
extraOptions = {
init_options = {
plugins = [
{
name = "@vue/typescript-plugin";
location = "${lib.getBin cfg.package}/lib/node_modules/@vue/language-server";
languages = [ "vue" ];
}
];
};
};
};
};
}
{
name = "yamlls";