Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [statet-users] document preview with internal Eclipse viewer does not reflect most recent changes

Hi John,

I agree that the current solution for HTML is not perfect.
The option "Auto-refresh local changes" in the browser viewer by Eclipse does not work if the file is replaced (only if it is edited directly), I created a bug report for the problem [1]. The view also doesn't offer an API to refresh, so StatET cannot refresh it programmatically. Apart from the mentioned bug, I think, the only better solution for StatET would be a separate Preview view similar to the R (Shiny) App Viewer view.
You can enter a bug in bugzilla against StatET for the issue if you want.

Regards,
Stephan

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=565464


[22.07.2020 16:55] John G. Bullock wrote:

I am using StatET 4.1.0 to render R Markdown documents as HTML. For the most part, the process works well. But the final stage -- document preview -- does not work well. The problem is that changes that I make to the Rmd file are not automatically reflected in the previewed HTML document. Is there a solution to this problem?

To elaborate: I am using the "Auto YAML using R:RMarkdown, single-step" configuration that comes with StatET. When I first create an Rmd document and use this configuration to produce and preview my HTML output, there is no problem. But when I change the Rmd document (for example, by adding text) and then produce and preview my HTML output a second time, the preview doesn't reflect the changes to the document. In Eclipse, focus changes to the "preview" view, but I see a HTML version of the old document, not the updated one.

In a sense, the problem seems clear. A new version of the HTML document is created outside of Eclipse (by rmarkdown::render()). Eclipse doesn't realize that the HTML document has changed, and as a result, its internal browser does not refresh.

There are workarounds. If I set the "Preview Operation" to be done with an external tool (like an external web browser), the latest changes to my document are always reflected. If I keep the default Preview Operation setting, "Open file using Eclipse" -- but hit refresh (F5) every time that focus switches to the preview tab -- the new changes are also reflected. But neither of these workarounds is completely satisfactory.

Other things that don't work:
* Setting "Auto-refresh local changes" in the preview tab.
* Enabling "Refresh using native hooks or polling" in Preferences > General > Workspace.

Thank you for any help that you can offer.


Back to the top