Skip to content

plugins/lsp/vue_ls: add vtslsIntegration option#3815

Open
sportshead wants to merge 2 commits intonix-community:mainfrom
sportshead:vue_ls-vtsls
Open

plugins/lsp/vue_ls: add vtslsIntegration option#3815
sportshead wants to merge 2 commits intonix-community:mainfrom
sportshead:vue_ls-vtsls

Conversation

@sportshead
Copy link
Copy Markdown
Contributor

Add a vue_ls integration by default for vtsls in addition to tsls which is already implemented (see #3771).

Haven't added it to Volar since it is deprecated anyway (#3600)

assertion = (cfg.tslsIntegration or cfg.vtslsIntegration) -> (cfg.package != null);
message = "When `${opts.tslsIntegration}` or `${opts.vtslsIntegration}` is enabled, `${opts.package}` must not be null.";
};
plugins.lsp.servers.ts_ls = lib.mkIf (cfg.enable && cfg.tslsIntegration) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
plugins.lsp.servers.ts_ls = lib.mkIf (cfg.enable && cfg.tslsIntegration) {
plugins.lsp.servers.ts_ls = lib.mkIf cfg.tslsIntegration {

Everything in extraConfig is already conditioned on cfg.enable:

lib.mkIf cfg.enable (
lib.mkMerge (
[
{ inherit extraPackages extraPlugins; }
(lib.optionalAttrs (isColorscheme && colorscheme != null) {
colorscheme = lib.mkDefault colorscheme;
})
# Apply any additional configuration added to `extraConfig`
(lib.optionalAttrs (args ? extraConfig) (
utils.applyExtraConfig {
inherit extraConfig cfg opts;
}
))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unresolved. Perhaps it was reverted in a rebase?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch, must have dropped it by accident

@MattSturgeon
Copy link
Copy Markdown
Member

I'm hesitant to add new features to plugins.lsp that we'll need to consider how to migrate to the new lsp and plugins.lspconfig replacements.

But I also don't want to block a PR on us figuring out how to approach that.

@sportshead
Copy link
Copy Markdown
Contributor Author

This doesn't really add a new feature per se, it only adds the existing feature (automatic vue_ls compatibility) to vtsls in addition to tsls which already had it. Although I do get what you mean, this does need to be migrated to the new lsp module eventually.

Add a vue_ls integration by default for vtsls in addition to tsls which is already implemented (see nix-community#3771). Haven't added it to Volar since it is deprecated anyway (nix-community#3600)
in
{
assertions = lib.nixvim.mkAssertions "plugins.lsp.servers.vue_ls" {
assertion = (cfg.tslsIntegration or cfg.vtslsIntegration) -> (cfg.package != null);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assertion = (cfg.tslsIntegration or cfg.vtslsIntegration) -> (cfg.package != null);
assertion = (cfg.tslsIntegration || cfg.vtslsIntegration) -> (cfg.package != null);

This is the wrong "or" operator; logical or (||) vs attribute selection fallback (or)

https://nix.dev/manual/nix/2.32/language/operators.html

};
};
};
plugins.lsp.servers.vtsls = lib.mkIf (cfg.enable && cfg.vtslsIntegration) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/nix-community/nixvim/pull/3815/changes#r2529224980 also applies here:

Suggested change
plugins.lsp.servers.vtsls = lib.mkIf (cfg.enable && cfg.vtslsIntegration) {
plugins.lsp.servers.vtsls = lib.mkIf cfg.vtslsIntegration {
assertion = (cfg.tslsIntegration or cfg.vtslsIntegration) -> (cfg.package != null);
message = "When `${opts.tslsIntegration}` or `${opts.vtslsIntegration}` is enabled, `${opts.package}` must not be null.";
};
plugins.lsp.servers.ts_ls = lib.mkIf (cfg.enable && cfg.tslsIntegration) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unresolved. Perhaps it was reverted in a rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants