gfm_viewer
gfm_viewer copied to clipboard
Update Navigator folder view with generated HTML files
The plugin typically writes .filename.md.html
files alongside the original filename.md
files. However since it does not use the Eclipse Workspace API to write the HTML files, these files not appear in the Navigator folder view immediately after creation. The user needs to press F5 (or context menu Refresh) on the parent folder to see them. See also: http://wiki.eclipse.org/FAQ_When_should_I_use_refreshLocal%3F
Therefore, there are several possible approaches to this issue;
- Use the
IFile.create()
API to write the file - Use the
IFile.refreshLocal()
API to refresh the parent folder - Do nothing as at present as these files are really of little interest to most users
There are two major complications to a solution:
- This plugin offers the option to have HTML files stored in an external temp folder outside the project, rather than alongside the markdown file, so both options must be correctly supported
- My recollection from earlier experiments with the
refreshLocal
API was that calling it seemed to force a complete rebuild of the whole parent project: with a large Java or Scala project this can take a long time and would be very intrusive to the user. So creation and updating of these files should not force a rebuild if possible.
Some more background: http://cvalcarcel.wordpress.com/2011/01/01/help-i-programmatically-created-a-resource-in-my-project-but-my-code-doesnt-find-it/
The user needs to press F5
In newest Eclipse there is option
General -> Workspace -> Refresh on access General -> Workspace -> Refresh using native hooks or polling
(so that you don't need to press F5
https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.help/contents/configuration.md#optional-general-eclipse-configuration
So if the file is really in folder I should see it after F5 or sometime, but in my experience it was not.
Just confirm that no other folders are used.
The HTML files are only visible in the Navigator view (by default) because the Project Explorer and similar views filter out files with a leading ".". The only other alternative is that you had the Use Temp folder option enabled, in which case the HTML files would never be visible under any circumstances.
BTW the point I mentioned about project rebuild overhead on refresh is very important.
By default I have all files shown, and I encourage everyone to disable filters on project files.
Please reopen #51 that is user oriented. And see if more people ask for that.
I think our opinions on the HTML files are not the same! To me, they are simply by-products of the display process and what Eclipse does to hide them is quite right.
So I think I'll wait for any further comments. I will review the IFile options again when time permits.