vscode-java-dependency icon indicating copy to clipboard operation
vscode-java-dependency copied to clipboard

[Improvement] - Referenced Libraries naming

Open mamilic opened this issue 1 year ago • 9 comments

As of now Referenced libraries are shown as list with jar names, and sometimes it is hard to guess what that is, for example we have core-3.4.0.jar, or context-2.3.2.jar, picture below.

image

Is it possible that to have something which intellij uses, to have groupId:artifactId:version?

image

mamilic avatar Oct 03 '24 10:10 mamilic

Sounds a valid request

jdneo avatar Oct 08 '24 00:10 jdneo

@jdneo , is this perhaps good first issue?

mamilic avatar Oct 09 '24 19:10 mamilic

@mamilic If we can easily get the group id, artifact id and version from the jar files, then this should be a good first issue.

I need to find some time to investigate it. It would be great if you are willing to have a try :)

jdneo avatar Oct 10 '24 00:10 jdneo

@jdneo , I can try. But if you have any hints where to look, please let me know. Thanks!

mamilic avatar Oct 10 '24 18:10 mamilic

I've a question actually. Does every maven jar contains this pom.properties?

Seems it's not in some cases:

Image

jdneo avatar Oct 12 '24 06:10 jdneo

It seems that you are correct, however as I observed we would always have MANIFEST.MF. Could it be possible that JDTLS somehow proivides more info about the jars/dependencies? Also, I am wondering how may I run the extension in debug mode, when I try to launch it from VSCode it starts but then throws rejected promise not handled within 1 second: Error: No delegateCommandHandler for java.resolvePath extensionHostProcess.js:162 stack trace: Error: No delegateCommandHandler for java.resolvePath at /home/mmilic/.vscode/extensions/redhat.java-1.35.1-linux-x64/dist/extension.js:2:1090351 at re (/home/mmilic/.vscode/extensions/redhat.java-1.35.1-linux-x64/dist/extension.js:2:1090645) at /home/mmilic/.vscode/extensions/redhat.java-1.35.1-linux-x64/dist/extension.js:2:1085429 at Immediate.<anonymous> (/home/mmilic/.vscode/extensions/redhat.java-1.35.1-linux-x64/dist/extension.js:2:1085449) at process.processImmediate (node:internal/timers:483:21) at process.callbackTrampoline (node:internal/async_hooks:130:17)

Do I need to do some presteps in order to run it?

mamilic avatar Oct 12 '24 15:10 mamilic

Oh, sorry the contributing doc is missing for this repo.

You need to run npm run build-server to build the required jar.

If you want to debug java code in https://github.com/microsoft/vscode-java-dependency/tree/main/jdtls.ext/com.microsoft.jdtls.ext.core/src, you need to install https://marketplace.visualstudio.com/items?itemName=yaozheng.vscode-pde. And reload your vscode after the installation.

Then when you debugging the extension, run Image after it's activated.

The code to get the jar files is at: https://github.com/microsoft/vscode-java-dependency/blob/6ee1c6bb29e293e3b7e5cd4477f8e5d43a0cf280/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/PackageCommand.java#L312

jdneo avatar Oct 14 '24 01:10 jdneo

@jdneo , thanks for guidance!

I've managed to get the Java Projects show Maven Dependecies in format groupId:artifactId:version, however they are not sorted alphabetically. What would be your approach for this?

Image

mamilic avatar Oct 14 '24 17:10 mamilic

I guess you can add a sort logic at https://github.com/microsoft/vscode-java-dependency/blob/6ee1c6bb29e293e3b7e5cd4477f8e5d43a0cf280/src/views/containerNode.ts#L41

jdneo avatar Oct 15 '24 00:10 jdneo

Fixed by #859

jdneo avatar Oct 31 '24 07:10 jdneo