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:
parent
3fa0e48726
commit
8fcf8a9ef1
1 changed files with 33 additions and 1 deletions
|
|
@ -119,7 +119,7 @@ let
|
||||||
};
|
};
|
||||||
ts_ls = {
|
ts_ls = {
|
||||||
# NOTE: Provide the plugin default filetypes so that
|
# 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 = {
|
extraConfig = {
|
||||||
plugins.lsp.servers.ts_ls = {
|
plugins.lsp.servers.ts_ls = {
|
||||||
filetypes = [
|
filetypes = [
|
||||||
|
|
@ -136,6 +136,38 @@ let
|
||||||
tinymist = {
|
tinymist = {
|
||||||
settingsOptions = import ./tinymist-settings.nix { inherit lib; };
|
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 = {
|
vls = {
|
||||||
extraOptions = {
|
extraOptions = {
|
||||||
autoSetFiletype = mkOption {
|
autoSetFiletype = mkOption {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue