Debugging GWT's JavaScript in Intellij - gwt

When I debug GWT's client code from Intellij, debugger shows variable names as they are in compiled JavaScript and not as they were named in Java:
When I move mouse over some variable I get ReferenceError:
I thought it is the task of source maps to convert between js and java names.
Have I configured something incorrectly or is it just the current state of source maps?

It appears do be a known GWT issue. Our developers are working with GWT team to support it in IDEA 15. You can track the progress here.
You can already try IDEA 15 EAP where it should partially work (not for all cases).

Related

GWT 2.5.1 + source maps (Super dev mode) - local variable evaluation

Trying to use Super Dev mode with a GWT 2.1.5 project.
I have configured Super dev mode (it works) I can see the sources in Javascript debugger, can use breakpoints, however I cannot evaluate variables at execution time.
Is there any trick to have Google Chrome's javascript debugger not trip on local variables evaluation ? Do I need to find another name for the variable (the actual name of the variable, not the name that is in the sources ?) for evaluation ?
See below.
edit: actually I think I have found part of the answer in GWT's official page. "When inspecting variables in the Chrome debugger, the field names and values are JavaScript, not Java.". I have no idea where those names can be seen, though, any help ?
Perhaps you could try switching off obfuscation? This is described in this document FAQ - Debugging and Compiling - Why is my GWT-generated JavaScript gibberish?. You could try the compiler parameters -style PRETTY or -style DETAILED
Also: the SDBG project allows source map debugging within the Eclipse IDE. There is a GitHub bug report on the issue you describe. It might help you: Add support for mapping field names.
I think it might be related to this question Why does Chrome debugger think closed local variable is undefined?
It is incredibly annoying for debugging purposes though, and any means to circumvent it would be welcome.

Scala # IntelliJ 12 - Can't fetch docs / some functions are not shown in dropdown. [BUGS]

I've been searching for a long time now to find a decent IDE for Scala.
Eclipse is not satisfying at all, as auto completion doesn't work, somehow. Also, I can't modify the libraries at all in the build path e.g. set the docs/source.
IntelliJ seems better, however, there are some major bugs:
When the drop down menu appears that lists all the function, some of them are sometimes just not shown! I think it's because of scala-library / scala-compiler, it mixes them up or something...
The docs cannot be fetched, I get this message over and over again (here the functions are listed, strange enough...):
This is the library window:
The dependencies and the compiler are set right, I strongly suppose.
Does anyone know what the problem is? And how to fix it? Or is it a known bug?
Is there an IDE that can handle Scala?
Regards!
Typically, searching for names (values/classes/functions/etc.) for auto-complete can be quite slow compared to Java in IntelliJ simply because the automatically imported namespace can be quite large, and it also searches through all implicit conversions. However, I've never seen it refuse to show functions like your screenshot, what version of IntelliJ and Scala plugin are you using?
I've never gotten the pop-up docs to work via attaching JavaDocs (I haven't tried remote fetching), so I'd recommend just ctrl+click to go through to the source to read the documentation there. (However, the function/type definition does popup correctly when sources are attached). I'd suggest posting an issue at http://youtrack.jetbrains.com/issues/SCL if you have the opportunity.
To your final question, the answer is unfortunately no. The tooling for Scala is nowhere near that of Java, but both Scala IDE for Eclipse and IntelliJ are making great progress in changing that, and both are strong in some areas while weak in others. In the end, you'll get limited support either way, so choose whichever fits you best.
I have found the solution to the problem:
The bug was caused by Java Decompiler Plugin. It tried to decompile the binaries of Scala's class-files, which obviously failed. This led to that error message and further led to the Scala plugin not working as it should, thus not displaying some of the functions.
This took me a long time to figure out, I installed 2 other versions of IntelliJ (which apparently imported the JD plugin), NetBeans and downloaded several builds of the Scala Plugin, only to discover this cause. Deactivating Java Decompiler solved it.
Regards.

how to debug GWT 2.4 in sigel with eclipse?

Exists some way to do hot redeploy when developing with gwt 2.4 in eclipse so i can make some change in the view like the text of a label and then press refresh or something like that and the modification appear? that problem is because the project i'm running takes at least 50 minutes to compile and wait 50 minutes just for one text of a label for example is hard...
Well ok, you're question is somewhat vague, but here's some points that hopefuly will help:
Yep, GWT compilation is slow. If you have a big GWT project, it might take good minutes for it to compile. This is sort of a known issue. What you can do to solve this is split your project into multiple GWT libraries and just compile the library you're currently working with.
Regarding hot deploy: your gwt project has two types of code: client code and server side code. The client side code (which is translated to Javascript by the GWT compiler) is hot-deployable. If you follow the instructions here:
https://developers.google.com/web-toolkit/gettingstarted
you'll have a "magic button" that lets you hot deploy your project into any of the more popular browsers. This means that you can modify your client-side code, refresh your browser and it's updated.
For the server-side code that doesn't work. AFAIK, you need to re-compile your project for those modification to be taken into account.
Have you tried GWT Designer?
Read more : https://developers.google.com/web-toolkit/tools/gwtdesigner/

GWT compiler doesn't create symbolMaps in the right place

I recently integrated gwt-log into my GWT and Maven based project mostly because of it's ability to automatically deobfuscate client side stack traces on the server. To make this possible gwt-log needs a so called symbol-map which maps all of the obfuscated symbol names to the original Java symbol names. The GWT compiler is capable of generating these symbol maps but for some reason they are saved to a strange location, eg.:
target/project-name-1.0-SNAPSHOT/project-name/.junit_symbolMaps/0F9FD6EF6A1BC63EA834AC33C7ED13F3.symbolMap
According to the GWT Maven Plugin Documentation the GWT compiler has a "-deploy" parameter which determines where to create files like that and which per default points to "WEB-INF/deploy". But even if I manually set this parameter to the correct location the compiler still creates the symbol-maps in the wrong folder.
I even downloaded the GWT Maven Plugin sources and added some log output to find out whether or not the "-deploy" parameter is passed correctly to the compiler but all seems fine.
Has anybody experienced a similar behavior?
Thanks!
Michael
Disable JUnit GWT Module.
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/552a9578a76587ae#

Eclipse: Using "Open Declaration" ... in a Scala project

I've been trying to convert from Java to Scala for a few months, and found that the greatest roadblock is that Eclipse plugin for Scala is hardly better then using Vim.
I normally have "Build Automatically" on, so apart from Open and Save, the commands I use most of the time are:
Open Declaration (F3)
References > Workspace (Ctrl-Shift-G)
Open Type Hierarchy (F4)
Open Type (Ctrl-Shift-T)
Content Assist (Ctrl-Space)
and looking at the Outline.
None of this works with the Scala IDE for the libraries. Some stuff works for my own code, like outline. But the rest just returns the following error:
The resource is not on the build path of a Java project.
Is there any way to get any of those things to work in Eclipse? Without them, basically the only thing I get is syntax highlight and compile-on-save, and I can get syntax highlight from vim without needing 1.5 GB of ram...
With implicits, and static function import, finding out from where something comes is really difficult without F3. I ended up using Google to find what class/trait defines what.
[EDIT] I just pulled Eclipse Classic 3.6.2, and update-1.0.0-milestones-2.8.1.final, which wasn't available the last time I checked. They have fixed the Outline, and "Open Type", that's it. The rest still doesn't work.
Which version of the Eclipse plugin are you using? If the version is from a while ago, then you're right, it's a bit buggy.
However, there is a new version, currently in beta (as of 23.04.2011) available from Scala IDE Eclipse download site. This is a lot better.
Also, please make sure that the 'Use JDT content assists' checkboxes are checked in Scala->Setup diagnostics window.
Please try the new version, and see if it fixes your problems. If not, raise a bug, and the team will fix it.