asciidoctor-intellij-plugin icon indicating copy to clipboard operation
asciidoctor-intellij-plugin copied to clipboard

Support preview on remote Intellij (Gateway)

Open eiswind opened this issue 2 years ago • 17 comments

Why the new feature should be added

It's currently a showstopper for anyone who wants to use the plugin in a remote IDE.

How the new feature should work

Currently the plugin (installed in the remote) complains that JCEF runtime is not present (although it is, but its clear that the problem lies in the nature of the ui being displayed on a different machine).

Please let me know if I can provide any support in solving this.

eiswind avatar Feb 26 '22 15:02 eiswind

Hi @eiswind - thanks for sharing this. I haven't used JetBrains Gateway yet, so this might be newbie questions:

  • Did you try other preview options besides JCEF (there is at least Swing)?
  • Do you experience the same issue for example with Markdown files?
  • Can you please provide a screenshot so I know where to look for the error message?

ahus1 avatar Feb 26 '22 16:02 ahus1

Bildschirmfoto von 2022-02-26 18-13-03

This does not work of course, because jcef runtime is on the host. But as you can see there is no icon bar, and no preview at all. In the settings there is the swing option active, but it doesn't render on the client.

I could live with the swing option, if it worked :)

Unfortunately I do not see an option to set the runtime for the Client. But I guess that will not help either, because the server would have to expose the preview on a separate port then.

eiswind avatar Feb 26 '22 17:02 eiswind

At least I found that the client is running with jcef enabled too. But I have no idea how one can glue that together.

Bildschirmfoto von 2022-02-26 18-25-40

eiswind avatar Feb 26 '22 17:02 eiswind

Thank you for the details, I can now investigate this further. I know that a similar problem exists for any custom preview for code-with-me, it might be the same problem. Let's see.

ahus1 avatar Feb 26 '22 17:02 ahus1

HI @ahus1 !

I gave it another try with the latest EAP of the Gateway. It looks like swing preview is working with that! only that gitpod does not support the eap yet :) mmhh

Bildschirmfoto von 2022-02-26 18-40-14

eiswind avatar Feb 26 '22 17:02 eiswind

Thanks for sharing this information. I tested it myself and it seems that Swing is the one thing that works. Unfortunately the Swing preview has the least functionality of all preview options.

Please up-vote (👍) and watch CWM-1199 to see when JetBrains offers additional APIs to have a better preview. This issue a prerequisite for better support in the AsciiDoc plugin.

There is one additional option: Click in the project view on the file with the right mouse button, and choose "Open In | Browser | Chrome" (or another browser). In my local setup (EAP 2022.1) the file then opens in the local browser with a preview. The preview doesn't refresh automatically (you'd need to press F5 here), still it might help with one or the other scenario.

The AsciiDoc editor with the swing preview seems to have a higher latency. There is at the bottom a tab where you can switch to the text editor without the preview.

I'd like to hear back from you how your experiences are with this solution. I'll then update the docs and close this issue until there is some progress on the issue linked above.

ahus1 avatar Feb 27 '22 17:02 ahus1

Thanks for helping me with this one. At least I can move on. Lets hope we see some progress on that issue.

eiswind avatar Feb 28 '22 07:02 eiswind

Unfortunately the Swing preview has the least functionality of all preview options.

I think that's a strong understatement. In fact, the Swing preview can hardly even call itself an HTML viewer. It has not kept up with web standards at all. As a result, the preview with the Asciidoctor stylesheet looks nothing like what users expect to see and it gives users a poor impression. I'd just like to see that mode go away.

mojavelinux avatar Feb 28 '22 07:02 mojavelinux

Hi @mojavelinux - it could be indeed an option to remove Swing preview completely.

At the moment at least Android Studio doesn't ship with neither JavaFX nor JCEF support out of the box; it is still unclear to me why Google ships it this way. It requires users to install additional plugins to make one of them work. Both are described in the docs, still it is a nuisance to do this.

All other plugins in IntelliJ have dropped support for the Swing preview for good reasons and now require JCEF to be present.

I'll leave this issue open to collect some more thoughts of those who want to comment here before I'll take any action.

ahus1 avatar Feb 28 '22 17:02 ahus1

As stated in the upstream issue, there is currently no other support than the Swing preview in Projector. Unfortunately this only works in Projector, not in CodeWithMe.

Therefore, for now, I'll keep the Swing preview.

ahus1 avatar Apr 24 '22 19:04 ahus1

Seems there is something cooking for 2023.3. I'll try to keep watching this.

eiswind avatar Oct 01 '23 14:10 eiswind

@eiswind - that's great news. A first EAP version of 2023.3 is available. Did you give the markdown support a try? Once the markdown maintainers have it working, I can give it an attempt to adapt it for the AsciiDoc Plugin.

ahus1 avatar Oct 01 '23 16:10 ahus1

As of yesterday there was no preview provider available. I'll try to monitor this.

eiswind avatar Oct 02 '23 06:10 eiswind

HI! Remote markdown preview seems to to implemented now (2024.1 EAP). I hope you can adopt this. Let me know if I can be of any help.

eiswind avatar Jan 31 '24 13:01 eiswind

Asked in the JetBrains SDK channel: This functionality is not yet available for 3rd party developers.

ahus1 avatar Feb 11 '24 15:02 ahus1

Thanks for your engagement. I still hope that someday in a far future I can use this in my devcontainers....

eiswind avatar Feb 11 '24 17:02 eiswind