You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[2.9.7] native GWT JSNI methods get a spurious () appended after }-*/, breaking compilation #957
When formatting a GWT JSNI native method, the plugin inserts an extra () between the closing JSNI delimiter }-*/ and the terminating semicolon. This corrupts the JSNI block and causes the GWT compiler to fail:
[ERROR] <no source info>: <source info not available>
[ERROR] at XX.java(91): XXX.getInitiator()Ljava/lang/String;
com.google.gwt.dev.jjs.ast.JMethod
This worked correctly before 2.9.7 (tested in 2.8.1) and is still broken in 2.10.1 (tested).
Thanks for reporting this issue! I wasn't aware of JSNI. I'll look into fixing this now and adding some tests for it to avoid this sort of regression in the future, but I wonder if it would also make sense to try to support formatting the JavaScript inside of the comments with Prettier as well, by treating it as an embedded language? I may work on that as a separate feature, similar to #794. Let me know if you have thoughts, as a user of JSNI.
Thanks for taking a look so soon and all the work you do for this project! Our JSNI methods are always quite short, normally just 1-3 lines, and we only have a handful of them, so having them properly formatted is not that important to us because it is easy to write them readable by ourselves. Ofc we would not be sad if they would be uniformly formatted, but they are currently not causing worries for us.
Activity
jtkiesel commentedon Jun 28, 2026
Thanks for reporting this issue! I wasn't aware of JSNI. I'll look into fixing this now and adding some tests for it to avoid this sort of regression in the future, but I wonder if it would also make sense to try to support formatting the JavaScript inside of the comments with Prettier as well, by treating it as an embedded language? I may work on that as a separate feature, similar to #794. Let me know if you have thoughts, as a user of JSNI.
ArLau commentedon Jun 29, 2026
Thanks for taking a look so soon and all the work you do for this project! Our JSNI methods are always quite short, normally just 1-3 lines, and we only have a handful of them, so having them properly formatted is not that important to us because it is easy to write them readable by ourselves. Ofc we would not be sad if they would be uniformly formatted, but they are currently not causing worries for us.