manage jdtls bundles with nix

This commit is contained in:
LordMZTE 2024-05-05 09:49:53 +02:00
parent 6a2bad0734
commit c974057a57
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
6 changed files with 47 additions and 27 deletions

View file

@ -39,7 +39,10 @@
:implementationsCodeLens {:enabled true}
:references {:includeDecompiledSources true}
:referencesCodeLens {:enabled true}
:updateBuildConfiguration :interactive}}
:updateBuildConfiguration :interactive
:decompilers {:cfr {:rename true
:antiobf true
:trackbytecodeloc true}}}}
:init_options {:bundles bundle-info.bundles
:extendedClientCapabilities (let [cap jdtls.extendedClientCapabilities]
(set cap.resolveAdditionalTextEditsSupport

View file

@ -87,7 +87,6 @@ fn lFindRuntimes(l: *c.lua_State) !c_int {
/// Returns a list of JDTLS bundles (plugins basically) and the preferred content provider
///
/// https://github.com/dgileadi/vscode-java-decompiler/tree/master/server
// TODO: add command to download these maybe?
fn lGetBundleInfo(l: *c.lua_State) !c_int {
const home = std.posix.getenv("HOME") orelse return error.HomeNotSet;
@ -122,7 +121,7 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
var iter = dir.iterate();
var idx: c_int = 1;
while (try iter.next()) |f| {
if (f.kind != .file or !std.mem.endsWith(u8, f.name, ".jar"))
if (!std.mem.endsWith(u8, f.name, ".jar"))
continue;
if (!has_cfr and std.mem.containsAtLeast(u8, f.name, 1, "cfr"))

View file

@ -103,28 +103,4 @@ in
mv * .* "$out"
'';
};
#pkgs.linkFarm "nvim-plugins"
# (lib.mapAttrsToList
# (name: src: {
# name = name;
# path = stdenv.mkDerivation {
# name = "${name}-compiled";
# inherit src;
# nativeBuildInputs = with pkgs; [ luajit luajitPackages.fennel ];
# buildPhase = ''
# # Compile source with mzte-nv-compile
# ${if mzte-nv-compiler != "" then "${mzte-nv-compiler} ." else ""}
# '';
# installPhase = ''
# mkdir -p "$out"
# mv * .* "$out"
# '';
# };
# })
# config.cgnix.nvim-plugins
# );
}

View file

@ -51,6 +51,7 @@ let
# Misc
html-tidy
shellcheck
tree-sitter
];
in
{

View file

@ -2,6 +2,7 @@
{
imports = [
./cgnix
./jdtls-bundles.nix
./mcdev.nix
./mzte-nix.nix
];

40
nix/jdtls-bundles.nix Normal file
View file

@ -0,0 +1,40 @@
{ pkgs, ... }:
{
config.packages.jdtls-bundles = pkgs.linkFarm "jdtls-bundles" [
{
name = "java-debug.jar";
path = pkgs.fetchurl {
url = "https://git.mzte.de/LordMZTE/-/packages/maven/com.microsoft.java-com.microsoft.java.debug.plugin/0.52.0/files/1444";
hash = "sha256-GjMQkxHVqp2H4dqh8NFW37N7kuBA2RWTIw9BYuyix4w=";
};
}
{
name = "decompiler-common.jar";
path = pkgs.fetchurl {
url = "https://git.mzte.de/LordMZTE/-/packages/maven/dg.jdt.ls.decompiler-dg.jdt.ls.decompiler.common/0.0.3-snapshot/files/1366";
hash = "sha256-qSgzUPmUtflDWisTG5RIA/UCPuZiOkP9NOI5zFwXC8E=";
};
}
{
name = "decompiler-procyon.jar";
path = pkgs.fetchurl {
url = "https://git.mzte.de/LordMZTE/-/packages/maven/dg.jdt.ls.decompiler-dg.jdt.ls.decompiler.procyon/0.0.3-snapshot/files/1393";
hash = "sha256-T+zzLbxrXOPW0Y8mnMKPFxAY1P7/VNKfRwOgcO9tnyo=";
};
}
{
name = "decompiler-fernflower.jar";
path = pkgs.fetchurl {
url = "https://git.mzte.de/LordMZTE/-/packages/maven/dg.jdt.ls.decompiler-dg.jdt.ls.decompiler.fernflower/0.0.3-snapshot/files/1384";
hash = "sha256-0uR8Pq4vBCz/lc8gE5S7IgfN6Axa4LBYarEJ+XbV3xk=";
};
}
{
name = "decompiler-cfr.jar";
path = pkgs.fetchurl {
url = "https://git.mzte.de/LordMZTE/-/packages/maven/dg.jdt.ls.decompiler-dg.jdt.ls.decompiler.cfr/0.0.3-snapshot/files/1375";
hash = "sha256-dxiKfDFecbXW/lGd5Ncbk1gldS30RhApCVcYYf0GRH0=";
};
}
];
}