-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support opening .class files directly within vscode #3
Comments
Not a stupid question. Opening a .class file directly is something that currently isn't supported. Instead, make sure you have a java project open in vscode and open a .java file that imports the class. Within that java file you can then right-click on that class symbol and choose Go to Definition. Hopefully in the future we can support opening .class files directly within vscode. |
@dgileadi Any update is available for this? |
@railsfactory-prabhu not right now. I have looked into it, though. There are two issues that make it hard. First, vscode doesn't support directly opening binary files, so for now I'd need to offer something like right-clicking on the .class file and choosing Decompile. Second, the awesome Redhat Java tools I'm piggy-backing on don't seem to have a method for directly opening a .class file. This means that I need to either make a fairly complicated workaround (search for the type by name and then request its contents) or build my own language server. Neither of those is simple, so I'm deferring for now. PR's welcome! |
Any update on this? Why does TextEdit seem to be able to read most of a class file whereas VS can't read any of it? |
As mentioned above it's a limitation of vscode and the Redhat Java tools. If you're able to figure out a way to make it work I'd be happy to incorporate your code. |
This takes me back to the class (.java file) and not .class file. No matter what I do, I can't seem to make it work, unfortunately. |
I've only seen this kind of behavior when the RedHat Java tools aren't working properly on my project. The decompiler extension depends on the RedHat Java extension to work properly. |
Yes, unfortunately with the current version of the plugin you're being unrealistic. If you had a Java project with your jar as one of the dependencies then it would work—Ctrl+T would allow you to enter the name of a class in the jar to examine and you'd be able to view its decompiled source. Or you could use Red Hat's Java Dependencies view to browse through the jar and click on individual classes within it. However being able to examine arbitrary .class files or classes within arbitrary .jar files is not something this plugin can do—it relies on Red Hat's java tools for loading class files, and they only work with dependencies in Java projects. |
No problem. I have no idea what the jar is doing. I know we call it via command line, but the rest of it is black magic. const command = `java -jar ${jarFile} generate -i ${swaggerFile} -l typescript-fetch -o ${outDir}`; I have no idea what classes or files are within it. I will get the Java Decompiler from the above image. Thank you for your help. |
Hi @dgileadi, Thank you so much for this extension! |
Any update for this feature addition pls |
I haven’t seen any updates, I gave up waiting and use IntelliJ as it has a built in decompiler for class files which works well.
Reg Graham
From: MD. SHAHIDUL ISLAM ***@***.***>
Date: Friday, 17 September 2021 at 04:32
To: dgileadi/vscode-java-decompiler ***@***.***>
Cc: REGINALD GRAHAM ***@***.***>, Author ***@***.***>
Subject: Re: [dgileadi/vscode-java-decompiler] Support opening .class files directly within vscode (#3)
Any update for this feature addition pls
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#3 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AH6GON5PT7NJNLWXYXZUKKDUCKZE3ANCNFSM4EB6KE6Q>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I've whipped up something to sorta achieve this with .class files |
Cool! |
It may be a stupid question I am using Visual Studio Code on a MAC and I cannot get the decompiler to work. I load a class file into the editor then go to definition but nothing happens?
The text was updated successfully, but these errors were encountered: