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

plugins/lsp/vue_ls: add a tslsIntegration option

This new `plugins.lsp.servers.vue_ls.tslsIntegration` is a shameless
copy of of pre-existing `plugins.lsp.servers.volar.tslsIntegration`
option.

Full disclosure: I have not tested this as I use the newer `lsp` module.

I'm not sure if this fixes
https://github.com/nix-community/nixvim/issues/3600, but it's a least
part of it.
This commit is contained in:
Jeremy Fleischman 2025-10-04 09:56:36 -07:00 committed by Matt Sturgeon
parent 3fa0e48726
commit 8fcf8a9ef1

View file

@ -119,7 +119,7 @@ let
};
ts_ls = {
# NOTE: Provide the plugin default filetypes so that
# `plugins.lsp.servers.volar.tslsIntegration` doesn't wipe out the default filetypes
# `plugins.lsp.servers.volar.tslsIntegration` and `plugins.lsp.servers.vue_ls.tslsIntegration` don't wipe out the default filetypes
extraConfig = {
plugins.lsp.servers.ts_ls = {
filetypes = [
@ -136,6 +136,38 @@ let
tinymist = {
settingsOptions = import ./tinymist-settings.nix { inherit lib; };
};
vue_ls = {
extraOptions = {
tslsIntegration = mkOption {
type = types.bool;
description = ''
Enable integration with TypeScript language server.
'';
default = true;
example = false;
};
};
extraConfig = cfg: opts: {
assertions = lib.nixvim.mkAssertions "plugins.lsp.servers.vue_ls" {
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 = lib.mkIf (cfg.package != null) [
{
name = "@vue/typescript-plugin";
location = "${lib.getBin cfg.package}/lib/language-tools/packages/language-server";
languages = [ "vue" ];
}
];
};
};
};
};
};
vls = {
extraOptions = {
autoSetFiletype = mkOption {