GWT Designer lags on xml source autocomplete - gwt

Some pretense:
Using MyEclipse 8.6 with GWT 2.2.0. As you know it comes with GWT Designer now.
I've noticed that while editing the xml within GWT Designer, every time I type in a new attribute to a tag it starts to lag. The exact point is when I press '='. This lag freezes eclipse for about 1-2 minutes. As you can imagine, it makes using XML Source for UIBinder almost unbearable. I assume the lag is due to eclipse looking up suggestions to put into an auto complete drop down, but it takes a whopping 1-2 minutes.
My question is:
How do you prevent eclipse from this type of lag while editing the XML source in GWT Designer? What are you developers doing to get around it?

Read here: https://groups.google.com/forum/#!topic/google-web-toolkit/2j0RulDMfgc/discussion.
You need to download the 2 xsd:
http://dl.google.com/gwt/dtd/com.google.gwt.user.client.ui.xsd
uibinder.xsd (replace com.google.gwt.user.client.ui.xsd in the url above. I can't post more than 2 urls yet...)
Then add them to the XmlCatalog (Window -> Preferences -> Xml -> XmlCatalog -> User Specified Entries -> Add.. -> FileSystem)
Worked for me.
Eclipse no longer freezes during auto complete. It still freezes if I try to format text by pressing ctrl+shift+F in the .ui.xml file.

Instead of using the WindowBuilder Editor, you can right-click on *.ui.xml file you're editing and select Open With -> UiBinder Template Editor. I am not using GWT Designer, and WindowBuilder doesn't have autocomplete for me at all, so I use UiBinder Template Editor instead.

I see a similar problem although I am using STS 2.6.0. I eventually worked around it by using the normal eclipse XML editor, right click Open With -> XML Editor but you lose autocomplete and some validation.
My first attempt was to add xhtml.ent, uibinder.xsd and com.google.gwt.user.client.ui.xsd to the XML Catalog as I suspected that it was something around blocking over the network getting these but that didn't help.
I also turned off all validation which also didn't have any effect.
So I wouldn't mind a definitive answer to this myself.

Related

Eclipse is very slow on Save Action. Any way to improve this?

I am using Eclipse 2019. It is very slow on Save Action. It is necessary for me to enable the Save Action to do code format and indent check. But it is really a pain to watch Eclipse busy and slow at that point.
Is there a way to improve this?
I am trying Intellij. It is much much better than Eclipse on the Save Action.
I really hope Eclipse has the same or similar performance.
EDIT:
I am using Eclipse IDE for Enterprise Java Developers, Version 2019-12.
I only installed two editor plugins: One for resource bundle file and one for bash file.
EDIT 2:
Sorry, I should say that the Save Action on big Java file is slow. We have many files are more than 2 thousand lines. Some of them are double, triple that size, or even more. We often see the dialog telling us that we can turn off the Save Action to shorten waiting time. I tested with Intellij. The same file, the same formatter and Save Action, there is no noticeable delay in Intellij but Eclipse needs more time (noticeable even that dialog does not show up) to finish the action. There is nothing to do with the change itself, change many places, or change one line is the same. My guess is that Intelliji may be tracing the changes during the process and do format and Save Action only on where is changed. But Eclipse may not tracing the changes during the process and do format and Save Action on the entire file at the end.
I have no source control and other things attached.
Were you saving with Ctrl-S?
I was having a similar (or the same problem) whenever I was Ctrl-C/V to copy/paste. It seems the underlying problem may have been that my Hyperlink key was "Ctrl", so that whenever I was about to Copy/Paste, it was trying to work out Hyperlink options - stalling the editor.
Changing the Hyperlink modifier key (General > Editors > Text Editors > Hyperlinking) to Alt and the slow copy/paste is no more.

How do I prevent superDevMode from appearing in my arguments?

I'm using Eclipse (Kepler) for a GWT application and for some reason, superDevMode keeps appearing in my arguments. We are stuck with GWT 2.4 which does not know what superDevMode is. I remove the argument, hit Apply and Debug to start the app, but when I look at the arguments again, -superDevMode is in there again. I am assuming there is some property that belongs to 2.6 (the version that was installed with the Eclipse plugin), but I can't seem to find it.
Update: Below, Adam recommended that I go to the GWT tab and take it out of superdevmode. Here is a screenshot of that tab:
There isn't a way to do that. The large area at the top of the tab (above the Super Dev Mode group) suggested that something was supposed to be there, so I set the project's GWT to 2.6. Sure enough, there was a Super/Classic dev mode selection. I set it to classic, saved the settings, and then put the project back to 2.4. The GWT tab looked exactly as it does above and the arguments now has "-nosuperDevMode" in it, which is also not recognized by 2.4.
Any help would be appreciated.
Thanks,
CC
I found a temporary workaround that comes with a caveat: I made the Eclipse Run Configuration file read-only.
Example path:
<YOUR_WORKSPACE>\.metadata\.plugins\org.eclipse.debug.core\.launches\<YOUR_RUN_CONFIG_NAME>.launch
Then whenever you bring up the Dev Mode Run Configuration in Eclipse it still shows the -superDevMode flag, but when you click the Close button it now asks you if you want to save and you can press No.
The big caveat: if you actually do want to change the Run Configuration Eclipse will ask if you want to save, you press Yes, the dialog closes, but it didn't actually save.
Easiest fix is to shutdown Eclipse, manually edit the .launch file to remove -superDevMode, make the file read-only, then start Eclipse again.
Here's the bug report.
Go to GWT tab (3rd from left) and switch from Super Development Mode to Classic Development Mode

Eclipse Helios x64 (Mac) - JSP editor hangs/freezes

I'm having issues with Eclipse Helios (3.6.2) x64 (32-bit, too) hanging/freezing frequently when I attempt to edit .jsp files using Eclipse's built-in editor (Web Tools, J2EE package). I've been doing editing with 3rd party apps, but I would really like to have proper JSP syntax highlighting and auto-completion. The same symptoms occur when I attempt to edit .html files in Eclipse, too (though it's not as much of an issue since little is lost using a 3rd party html editor).
They are just plain .jsp files... not part of a J2EE or Web Project. The issue seems to be whenever I attempt to add tags... but it doesn't seem to consistently cause the problem. It seems to be temperamental.
Think it's a reference issue of sorts? Auto-completion issue in Eclipse?
I saw that other people had issues with this, but I wasn't able to find a clear cut solution. Any help would be greatly appreciated!
Old question that probably is resolved already. But in case anyone comes across this question in a search, it might be helpful to know that there is a bug reported about this
That usually happens as eclipse plug-ins are lazy loaded. JSP editor is loaded the first tim you attempt to load any JSP. It generally takes a while, ranging from few seconds to couple of minutes. Just wait for this duration the first time and the JSP editor would load very quickly until the next restart. My tip is to avoid closing/restarting eclipse altogether.
Also, to further speed up the load time, turn off any validators (such as JavaScript syntax validator) which you think you may never need.

Eclipse JSF + facelet - opening and editing page is slow

When opening JSF page (JSF + Apache Trinidad + facelet) in Eclipse (Helios), Eclipse freezes for a few seconds before the page is opened.
Also when editing the page, code complete / syntax verification is slow - for example I type <tr: and again I have to wait a few seconds before I can continue typing or tr tags are display.
It is very annoying that I have to wait each time when typing opening tag and slows me down a lot.
I am also using custom facelet tags.
What to do to avoid Eclipse freezing / slowing down? Do I have to change any configuration to speed it up?
I tried using the XHTML Editor instead of the JSF editor, and the freezing seems to have stopped.
I right clicked on my *.xhtml file and selected Open with->XHTML Designer
Also, you could change the way *.xhtml files are opened by going to Window->Preferences, then General->Editors->File Associations. Select the *.xhtml extension from the File types: pane, and then select XHTML Designer in the Associated editors: pane. To make the XHTML Editor the default editor for *.xhtml files, click the "Default" button next to the Associated editors: pane.
Turn off hyperlinks in your editor by going to the following path
Go to Window -> Preferences -> General -> Editors -> Text Editors -> Hyperlinking preference,
uncheck the option Open Declaration
I had this problems for weeks, and I've found a solution:
Install JBoss Tools > JBoss Web and Java EE Development > Visual Page
Editor (only this subpackage)
After you can edit XHTML files with:
Open with > JBoss Tools HTML Editor
It's faster and gives you a better page preview
Some profiling show that the slowness is due to
org/eclipse/jst/jsf/context/symbol/internal/impl/IJavaTypeDescriptor2Impl.class
Its related to org.eclipse.jst.jsf.common_1.2.2.v201101211220.jar of WebTool 1.2.2
The solution is to update to the last WebTool version
WebTool 3.6.2 update page
using Update Webtool Luna link
Adding metadata-complete=true to WEB-INF/faces-config.xml is a good way to prevent WebTool packages classes scanning, but AnnotationConfigurator.createFacesConfig must be modified !
For eclipse
Windows -> Preferences -> Editor -> File associations
then select XHtml.
After the selection there will be three options in the bottom window select HTML editor and click default. This solved the problem for me.
Please make sure to close all the opened XHtml pages and restart the eclipse.

How does Eclipse do code completion specific to third-party frameworks?

How does the Eclipse editor work to enable code completion? For example, within the XML editor for Hibernate property files, if I ctrl-space within a tag, a list of possible value relevant to hibernate will show up.
I understand that the XML editor is pre-configured to understand xml tag, but how about tag specific to a particular framework? How does Eclipse know about that?
I believe that the eclipse XML editor gets the content assist information from any referenced DTDs, or XMLSchema information it associates with the XML file. Try this experiment: Remove the DOCTYPE entry at the beginning of the file and see if content assist still works.
If you're interested in writing your own content assistants, you may want to start by reading the following:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/editors_contentassist.htm
In a nutshell, like most things in Eclipse, this is a platform hook. When you press the button, it queries all the registered assistants (I'm simplifying here), and they provide suggestions based on the current element or even the current content.
When writing a source editor or viewer for a particular language or document type, it is common to provide at least some rudimentary content assistants.
Removed the DOCTYPE entry at the beginning of the file and im now able to see the commands while typing ctrl+space...
To add to Uri's answer, you can define your own editor for your own language with XText as long as you have a simple EBNF grammar language for your DSL (domain specific language).
You will have:
syntax coloring,
model navigation (F3, etc.),
code completion,
outline view, and
code templates.
Here is a solution you can work. Actually I was facing a same problem with struts.xml file. I was not able to produce tags by cntrl+space
what i did was...
go to Preferences...Java...Editor...Content Assist...Advanced
check all the check-boxes ON and press OK.
sometimes the problem persists due to some false alarming in eclipse. If it happens, just delete your xml file and create a new one in same location.
I hope it will help.
I had the same issue while using the struts.xml file.
I got fix when I tried below...
Go to “Preferences>Java>Editor>Content Assist>Advanced“. Make sure “Java Non Types Proposals” are ticked on both the places as shown in the image below then click Apply and OK button:-