Every time I edit in JavaScript Editor, it triggers IResourceChangeEvent [message #1817937] |
Tue, 03 December 2019 06:20  |
Eclipse User |
|
|
|
Hey guys, I've come across a very scratchy bug.
The background is that I have developed an Eclipse plugin which listens to file change with org.eclipse.core.resources.IResourceChangeListener and refreshes the org.eclipse.swt.browser.Browser.
Everything works fine except that when I am editing JS file using org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor (JavaScript Editor for short), once the content assist is activated, every character I type in the editor can trigger the IResourceChangeEvent and refresh the browser. Annoying, isn't it?
I have tried in vain several times googling and fixing the bug, utilizing every API I can think of to distinguish between these two events, including
- IResourceChangeEvent.getType() (their outputs are the same)
- IResourceChangeEvent.getDelta().getFlags() (outputs are the same, too)
- IResourceChangeEvent.getDelta().getMarkerDeltas() (delta length is always 0)
- IResourceChangeEvent.getResource() (get null)
They just can't be differentiated!
Any idea on tackling with the bug elegantly? Your solution is appreciated!
[Updated on: Tue, 03 December 2019 18:43] by Moderator
|
|
|
|
|
Re: Every time I edit in JavaScript Editor, it triggers IResourceChangeEvent [message #1818088 is a reply to message #1817956] |
Thu, 05 December 2019 07:18  |
Eclipse User |
|
|
|
Hi Nitin,
To compromise I have added a "lock" switch to stop unwanted auto-refresh while I'm editing in JS Editor.
But after all, is there any other API apart from IResourceChangeEvent I can utilize to listen to file changes while not interfering with the content assist mechanism of JS Editor?
Otherwise, is Eclipse team looking into the mechanism of JS Editor content assist to find out what has gotten in the way of IResourceChangeEvent?
Thanks ahead :D
|
|
|
Powered by
FUDForum. Page generated in 0.27121 seconds