diff --git a/mzte-nv/conf/ftplugin/java.fnl b/mzte-nv/conf/ftplugin/java.fnl index 5b27489..eefed50 100644 --- a/mzte-nv/conf/ftplugin/java.fnl +++ b/mzte-nv/conf/ftplugin/java.fnl @@ -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 diff --git a/mzte-nv/src/modules/jdtls.zig b/mzte-nv/src/modules/jdtls.zig index e6ec06e..fdf1d73 100644 --- a/mzte-nv/src/modules/jdtls.zig +++ b/mzte-nv/src/modules/jdtls.zig @@ -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")) diff --git a/nix/cgnix/nvim-plugins.nix b/nix/cgnix/nvim-plugins.nix index 65046a8..bfde519 100644 --- a/nix/cgnix/nvim-plugins.nix +++ b/nix/cgnix/nvim-plugins.nix @@ -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 - # ); } diff --git a/nix/cgnix/nvim-tools.nix b/nix/cgnix/nvim-tools.nix index 6209b01..d4de0d1 100644 --- a/nix/cgnix/nvim-tools.nix +++ b/nix/cgnix/nvim-tools.nix @@ -51,6 +51,7 @@ let # Misc html-tidy shellcheck + tree-sitter ]; in { diff --git a/nix/default.nix b/nix/default.nix index d527bd1..f683994 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -2,6 +2,7 @@ { imports = [ ./cgnix + ./jdtls-bundles.nix ./mcdev.nix ./mzte-nix.nix ]; diff --git a/nix/jdtls-bundles.nix b/nix/jdtls-bundles.nix new file mode 100644 index 0000000..633b1b5 --- /dev/null +++ b/nix/jdtls-bundles.nix @@ -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="; + }; + } + ]; +}