Skip to content

Commit 2e3083e

Browse files
committed
plugins/lsp: rename tsserver to ts-ls
1 parent 95b322a commit 2e3083e

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

plugins/lsp/language-servers/default.nix

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,9 @@ let
621621
settingsOptions = import ./tinymist-settings.nix { inherit lib helpers; };
622622
}
623623
{
624-
name = "tsserver";
625-
description = "tsserver for TypeScript";
624+
name = "ts-ls";
625+
serverName = "ts_ls";
626+
description = "ts_ls for TypeScript";
626627
package = "typescript-language-server";
627628
}
628629
{
@@ -694,14 +695,26 @@ let
694695
description = "zls for Zig";
695696
}
696697
];
698+
renamedServers = {
699+
tsserver = "ts-ls";
700+
};
697701
in
698702
{
699703
imports =
700704
let
701705
mkLsp = import ./_mk-lsp.nix;
702706
lspModules = map mkLsp servers;
707+
baseLspPath = [
708+
"plugins"
709+
"lsp"
710+
"servers"
711+
];
712+
renameModules = mapAttrsToList (
713+
old: new: lib.mkRenamedOptionModule (baseLspPath ++ [ old ]) (baseLspPath ++ [ new ])
714+
) renamedServers;
703715
in
704716
lspModules
717+
++ renameModules
705718
++ [
706719
./ccls.nix
707720
./efmls-configs.nix

plugins/none-ls/prettier.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
with lib;
33
let
44
cfg = config.plugins.none-ls.sources.formatting.prettier;
5-
tsserver-cfg = config.plugins.lsp.servers.tsserver;
5+
ts-ls-cfg = config.plugins.lsp.servers.ts-ls;
66
in
77
{
88
options.plugins.none-ls.sources.formatting.prettier = {
99
disableTsServerFormatter = mkOption {
1010
type = with types; nullOr bool;
1111
description = ''
12-
Disables the formatting capability of the `tsserver` language server if it is enabled.
12+
Disables the formatting capability of the `ts-ls` language server if it is enabled.
1313
'';
1414
default = null;
1515
example = true;
1616
};
1717
};
1818

1919
config = mkIf cfg.enable {
20-
warnings = optional ((cfg.disableTsServerFormatter == null) && tsserver-cfg.enable) ''
20+
warnings = optional ((cfg.disableTsServerFormatter == null) && ts-ls-cfg.enable) ''
2121
You have enabled the `prettier` formatter in none-ls.
22-
You have also enabled the `tsserver` language server which also brings a formatting feature.
22+
You have also enabled the `ts-ls` language server which also brings a formatting feature.
2323
24-
- To disable the formatter built-in the `tsserver` language server, set
24+
- To disable the formatter built-in the `ts-ls` language server, set
2525
`plugins.none-ls.sources.formatting.prettier.disableTsServerFormatter` to `true`.
2626
- Else, to silence this warning, explicitly set the option to `false`.
2727
'';
2828

29-
plugins.lsp.servers.tsserver =
29+
plugins.lsp.servers.ts-ls =
3030
mkIf
3131
(
3232
cfg.enable
33-
&& tsserver-cfg.enable
33+
&& ts-ls-cfg.enable
3434
&& (isBool cfg.disableTsServerFormatter)
3535
&& cfg.disableTsServerFormatter
3636
)

tests/test-sources/plugins/lsp/_lsp.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
texlab.enable = true;
211211
tflint.enable = true;
212212
tinymist.enable = true;
213+
ts-ls.enable = true;
213214
typos-lsp.enable = true;
214215
typst-lsp.enable = true;
215216
vala-ls.enable = true;

0 commit comments

Comments
 (0)