Vscode-java: Broken images in javadoc when images are included in source JAR

Created on 26 Jul 2019  路  14Comments  路  Source: redhat-developer/vscode-java

When I hover cursor over the method I see docs. But images are broken, see screenshot
Screenshot 2019-07-26 at 14 33 09

It is very useful to see this algorithm image in case of reactor project, but I can not with VSCode java

Environment
  • Operating System:
    MacOS
  • Visual Studio Code version:
    Insiders 1.37-0, 6d82826e990407364d5c829b73602a19ecdf7d00
  • Java extension version:
    0.47
bug hover need info

Most helpful comment

Ok I see the issue now. With 3.2.10.RELEASE, the image is embedded in the jar:

/**
     * Create a {@link Mono} that terminates with the specified error immediately after
     * being subscribed to.
     * <p>
     * <img class="marble" src="doc-files/marbles/error.svg" alt="">
     * <p>
     * @param error the onError signal
     * @param <T> the reified {@link Subscriber} type
     *
     * @return a failing {@link Mono}
     */

All 14 comments

mmm works for me on macOS
Screen Shot 2019-07-26 at 1 47 27 PM

can you please provide the verbose logs, to see what is returned by the server on the hover request?

Oh, thanks. Here they are, attached. It isn't working for me from the beginning. I also tried download clean vscode, installed only java extension pack, result still the same
lang_server.log.zip

I also tried now to open clean project from start.spring.io

please provide the verbose logs. ("java.trace.server":"verbose")

Screenshot 2019-07-26 at 15 09 07

But logs look still the same. Ok. I will reboot few times

UPD
Logs from clean and fresh stable vscode with only java extension pack installed, with verbose option (after system reboot)
lang_server.log.zip

and I see images with another ide. I also tried gradle / maven projects, still the same. I also removed gradle and .m2 caches to refresh all dependencies. Tried to use "home" internet and mobile hotspot. Can not check with another computer

Please provide the full message logging in the Output view (select Language support for Java in the view menu)

[Trace - 3:30:16 PM] Sending request 'textDocument/hover - (43)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/jness/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java"
    },
    "position": {
        "line": 11,
        "character": 11
    }
}


[Trace - 3:30:16 PM] Received response 'textDocument/hover - (43)' in 39ms.
Result: {
    "contents": [
        {
            "language": "java",
            "value": "<Object> Mono<Object> reactor.core.publisher.Mono.empty()"
        },
        "Create a [Mono](jdt://contents/reactor-core-3.2.10.RELEASE.jar/reactor.core.publisher/Mono.class?=demo/%5C/Users%5C/jness%5C/.m2%5C/repository%5C/io%5C/projectreactor%5C/reactor-core%5C/3.2.10.RELEASE%5C/reactor-core-3.2.10.RELEASE.jar%3Creactor.core.publisher%28Mono.class#101) that completes without emitting any item.\n\n![Image]()\n\n *  **Type Parameters:**\n    \n     *  **<T>** the reified Subscriber type\n *  **Returns:**\n    \n     *  a completed [Mono](jdt://contents/reactor-core-3.2.10.RELEASE.jar/reactor.core.publisher/Mono.class?=demo/%5C/Users%5C/jness%5C/.m2%5C/repository%5C/io%5C/projectreactor%5C/reactor-core%5C/3.2.10.RELEASE%5C/reactor-core-3.2.10.RELEASE.jar%3Creactor.core.publisher%28Mono.class#101)"
    ]
}

lang_ser.log.zip

Ah now we can see the image link is not returned. Whereas I'm getting ![Image](https://raw.githubusercontent.com/reactor/reactor-core/v3.0.5.RELEASE/src/docs/marble/error.png)

Which version of mono are you using? please share a standalone java project reproducing this issue.

yeah, I see. This is actual for any project with reactor, also I just tried start.spring.io web-flux.
I don't know any other java doc with images to check...
demo.zip

Ok I see the issue now. With 3.2.10.RELEASE, the image is embedded in the jar:

/**
     * Create a {@link Mono} that terminates with the specified error immediately after
     * being subscribed to.
     * <p>
     * <img class="marble" src="doc-files/marbles/error.svg" alt="">
     * <p>
     * @param error the onError signal
     * @param <T> the reified {@link Subscriber} type
     *
     * @return a failing {@link Mono}
     */

to fix that we'd need to automatically extract embedded images and rewrite the image links for the generated markdown. Might be tricky

@NikolasKomonen is this something you want to look at?

Looking into this one

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shawmanz32na picture shawmanz32na  路  3Comments

bilymed picture bilymed  路  3Comments

sfariaNG picture sfariaNG  路  3Comments

protoEvangelion picture protoEvangelion  路  3Comments

ulongx picture ulongx  路  4Comments