Added node support

This commit is contained in:
Fred Drake
2024-10-05 21:45:06 -04:00
parent ee5b6054c1
commit 3034aa64aa
6 changed files with 222 additions and 129 deletions
+28
View File
@@ -0,0 +1,28 @@
{pkgs, ...}: {
plugins = {
dap = {
enable = true;
adapters.servers = {
"pwa-node" = {
host = "localhost";
port = 8123;
executable = {
command = "${pkgs.vscode-js-debug}/bin/js-debug";
};
};
};
};
};
extraConfigLua = ''
require("dap").configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "''${file}",
cwd = "''${workspaceFolder}",
},
}
'';
}
+16
View File
@@ -0,0 +1,16 @@
let
# Read all files in the current directory
files = builtins.readDir ./.;
# Filter out default.nix and non-.nix files
nixFiles = builtins.filter
(name: name != "default.nix" && builtins.match ".*\\.nix" name != null)
(builtins.attrNames files);
# Create a list of import statements
imports = map (name: ./. + "/${name}") nixFiles;
in {
# Import all configuration modules automatically
imports = imports;
}
+52
View File
@@ -0,0 +1,52 @@
{
plugins = {
conform-nvim = {
settings = {
formatters_by_ft.javascript = ["prettier"];
formatters_by_ft.typescript = ["prettier"];
formatters_by_ft.javascriptreact = ["prettier"];
formatters_by_ft.typescriptreact = ["prettier"];
};
};
lsp.servers.ts-ls = {
enable = true;
filetypes = [
"javascript"
"javascriptreact"
"typescript"
"typescriptreact"
];
extraOptions = {
settings = {
javascript = {
inlayHints = {
includeInlayEnumMemberValueHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayVariableTypeHints = true;
};
};
typescript = {
inlayHints = {
includeInlayEnumMemberValueHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayVariableTypeHints = true;
};
};
};
};
};
lsp.servers.eslint.enable = true;
none-ls.sources.formatting.prettier = {
enable = true;
disableTsServerFormatter = false;
};
};
}
-4
View File
@@ -175,8 +175,6 @@ in
formatters_by_ft = {
css = ["prettier"];
html = ["prettier"];
javascript = ["prettier"];
javascriptreact = ["prettier"];
json = ["prettier"];
just = ["just"];
lua = ["stylua"];
@@ -185,8 +183,6 @@ in
ruby = ["rubyfmt"];
terraform = ["tofu_fmt"];
tf = ["tofu_fmt"];
typescript = ["prettier"];
typescriptreact = ["prettier"];
yaml = ["yamlfmt"];
};
};