Repository navigation
Expand file tree
/
Copy pathjavascript.nix
More file actions
81 lines (72 loc) · 1.77 KB
/
Copy pathjavascript.nix
File metadata and controls
81 lines (72 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
config,
lib,
pkgs,
...
}: let
inherit (import ./lib.nix {inherit config lib;}) web-formatters;
in {
options.nv.langs.javascript.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable JavaScript/TypeScript language support";
};
config = lib.mkIf config.nv.langs.javascript.enable {
lsp = {
servers = {
oxlint = pkgs.lib.mkIf (config.nv.web-toolchain
== "oxc") {
enable = true;
config.require_config_file = true;
};
biome = pkgs.lib.mkIf (config.nv.web-toolchain
== "biome") {
enable = true;
config.require_config_file = true;
};
vtsls = {
enable = true;
};
};
};
plugins = {
conform-nvim.settings.formatters_by_ft = {
javascript = web-formatters;
javascriptreact = web-formatters;
typescript = web-formatters;
typescriptreact = web-formatters;
};
dap = {
adapters = {
servers.pwa-node = {
host = "localhost";
port = "\${port}";
executable = {
command = "${pkgs.vscode-js-debug}/bin/js-debug";
args = [
"\${port}"
];
};
};
};
configurations = {
javascript = [
{
type = "pwa-node";
request = "launch";
name = "Launch file";
program = "\${file}";
cwd = "\${workspaceFolder}";
port = 9229;
}
];
};
};
treesitter.grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
javascript
tsx
typescript
];
};
};
}