Skip to main content



      Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Every time I edit in JavaScript Editor, it triggers IResourceChangeEvent(Trouble with editing JS file with wst JavaScript Editor)
Every time I edit in JavaScript Editor, it triggers IResourceChangeEvent [message #1817937] Tue, 03 December 2019 06:20 Go to next message
Eclipse UserFriend
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 #1817956 is a reply to message #1817937] Tue, 03 December 2019 10:17 Go to previous messageGo to next message
Eclipse UserFriend
What are the types and flags you're getting?
Re: Every time I edit in JavaScript Editor, it triggers IResourceChangeEvent [message #1817964 is a reply to message #1817956] Tue, 03 December 2019 11:44 Go to previous messageGo to next message
Eclipse UserFriend
type: (int) 1
flag: (int) 0
Both are the case.
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:RESTful Service in Java using JAX-RS and Jersey - Blank page and HTTP Status 404 error
Next Topic:Facet Project Problem - OpenJDK13.0.1 & Tomcat 9.0.30 - Dynamic Web Project
Goto Forum:
  


Current Time: Tue Jul 01 14:08:22 EDT 2025

Powered by FUDForum. Page generated in 0.27121 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top