asciidoctor-intellij-plugin
asciidoctor-intellij-plugin copied to clipboard
Support preview on remote Intellij (Gateway)
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.
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?
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.
At least I found that the client is running with jcef enabled too. But I have no idea how one can glue that together.
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.
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
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.
Thanks for helping me with this one. At least I can move on. Lets hope we see some progress on that issue.
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.
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.
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.
Seems there is something cooking for 2023.3. I'll try to keep watching this.
@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.
As of yesterday there was no preview provider available. I'll try to monitor this.
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.
Asked in the JetBrains SDK channel: This functionality is not yet available for 3rd party developers.
Thanks for your engagement. I still hope that someday in a far future I can use this in my devcontainers....