feat(langs): java

This commit is contained in:
2025-07-31 14:53:46 +08:00
parent f730d8d118
commit 244844242f
5 changed files with 28 additions and 6 deletions

View File

@@ -50,6 +50,8 @@ lib.my.makeHomeProgramConfig {
typescript
nodejs
java-language-server
ripgrep
];
};

View File

@@ -9,6 +9,7 @@ local servers = {
"cssls",
"nixd",
"html",
"java_language_server",
}
local extra_config = {
@@ -73,7 +74,6 @@ capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
local lspconfig = require("lspconfig")
for _, server in ipairs(servers) do
local extra = extra_config[server] or {}
local config = {
@@ -82,5 +82,6 @@ for _, server in ipairs(servers) do
for k, v in pairs(extra) do
config[k] = v
end
lspconfig[server].setup(config)
vim.lsp.config(server, config)
vim.lsp.enable(server)
end

View File

@@ -15,6 +15,7 @@ lib.my.makeSwitch {
python.enable = true;
rust.enable = true;
lua.enable = true;
java.enable = true;
qml.enable = true;
};
};

View File

@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "java";
optionPath = [
"coding"
"langs"
"java"
];
config' = {
my.home.home.packages = with pkgs; [
openjdk24
];
};
}