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 typescript
nodejs nodejs
java-language-server
ripgrep ripgrep
]; ];
}; };

View File

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

View File

@@ -15,6 +15,7 @@ lib.my.makeSwitch {
python.enable = true; python.enable = true;
rust.enable = true; rust.enable = true;
lua.enable = true; lua.enable = true;
java.enable = true;
qml.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
];
};
}

View File

@@ -13,10 +13,8 @@ lib.my.makeSwitch {
"minecraft" "minecraft"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.home.home.packages = [
hmcl pkgs.hmcl
openjdk21
]; ];
my.persist.homeDirs = [ my.persist.homeDirs = [