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

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.

Related

VS Code / IDEs: How can I enable cmd+click goto definition for variables declared at runtime?

I'm looking to improve my own productivity by trying to figure out how to provide cmd+click functionality for variables declared at runtime. I work with a library that allows you to register objects to it at runtime to be accessed later — it would be great if I could cmd+click to definitions of these! How do you think I could achieve this? I'm open to any ideas. Thanks!
Edit:
Thoughts I have so far inspired by feedback from various Slack communities:
There is no such thing as 'runtime' when providing functionality in IDEs
We need to be able to teach the IDE about what definitions to expect. Whether this means writing an extension to use the VS Code API specifically for my use-case, or otherwise working within a system that generates files that the IDE already knows to look for, which allows it to connect the dots and provide the precious peek / goto definition functionality
Edit:
I'm starting work on a VS Code extension that reads a dotfile for configuration — I'll share what I find out as I go!

Path traversal vulnerabilities not found at Scala code

I have been trying to scan my code by using SonarQube + FindBugs + FindSecBugs plugins.
The idea is to detect vulnerabilities in the code, and as it says in the github project subject, it works with scala https://github.com/find-sec-bugs/find-sec-bugs
I have installed the plugin as the documentation says, and tried a few scans but nothing related to vulnerabilities in scala is coming up.
So, in order to figure out if the code was really good or there was a misconfiguration on my SonarQube settings, I went to http://find-sec-bugs.github.io/bugs.htm, I took one of the examples (Potential Path Traversal), inserted the example code and I ran the scanner again. It was not found.
The rule (Security - Potential Path Traversal (file read)) is activated in the Quality Profile, and despite it is a Java profile, it is assigned to the project, since the code in the mentioned example is Scala.
I noticed that all the rules coming from find-sec-bugs are java ones, so I'm wondering if they don't work on scala or there is something else I can do to make it work.
Thanks in advance, and let me know if you need any extra information, I'd be glad to provide you.
Looks like the main reason for that to happen is that Scala bug patterns are explicitly excluded for some reasons:
Their are plenty of limitation with the SonarQube architecture regarding the multi-language support.
It is closely tie to the sonar-source plugin design.
Language can't have the same extension (https://jira.sonarsource.com/browse/MMF-672)
Repository can't contains rule that apply to multiple languages. (If you would have Scala only code, the Java core rules would not be enable unless you have one Java file present)
Sensor are couple to the language definition (depends on the most popular plugin that declares it).
etc, etc..
Source: https://github.com/spotbugs/sonar-findbugs/issues/108#issuecomment-305909652
All the exclusions can be seen here: https://github.com/spotbugs/sonar-findbugs/commit/526ca6b29fae2684f86b1deba074a4be8a05b67e
Particularly, for Scala:
static exclusions = ['CUSTOM_INJECTION',
'SCALA_SENSITIVE_DATA_EXPOSURE',
'SCALA_PLAY_SSRF',
'SCALA_XSS_TWIRL',
'SCALA_XSS_MVC_API',
'SCALA_PATH_TRAVERSAL_IN',
'SCALA_COMMAND_INJECTION',
"SCALA_SQL_INJECTION_SLICK",
"SCALA_SQL_INJECTION_ANORM",
"PREDICTABLE_RANDOM_SCALA"]

Debugging GWT's JavaScript in Intellij

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).

Is it possible to set a debug point in FreeMarker template file?

I have a lot of coding in FreeMarker template files for view layer in my app.
I was wondering if I can set a debug point with Eclipse. Is there any good plugin that I can use to debug FreeMarker template files?
As far as I know, you cannot. A template file is a plain text file that the template engine reads into memory and then uses to produce a document that it writes to the response. It's not actually executable code. You can put a breakpoint in the template engine code and follow along what it replaces and how.
FreeMarker has a debugging API, although it has stuck in experimental state eons ago, mostly because nobody has taken the effort to write a front-end for it (like an Eclipse plugin). Except, I know they have planned to support it under some of the next LifeRay IDE versions. As far as I know they managed with break points, but there's no support for stepping in the FreeMarker API for example.
This is an old question and answering it right now doesn't make sense, but maybe it helps to all those people who often visit this page to find whether there is a way to debug freemarker or not.
As in the earlier answer it was stated that there is an Official API for the debugging, so just to add a little more into it for beginners.
Please refer to this official API and check freemarker.debug package [as official description says - Debugging API; experimental status, might change! This is to support debugging in IDE-s.], it is surely to help.
FreeMarker 2.3.29

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.