Thursday, April 30, 2015

Future Proof NetBeans IDE: Filter Out JavaScript Parser Errors

By: Geertjan Wielenga | Product Manager

Yes, it's a crazy, crazy world, with each day so full of JavaScript.

React.js is the cool kid of the hour and, of course, in terms of end-to-end tooling, NetBeans IDE is great. In other words, you can set up your React.js application in seconds (and forget the command line completely), use Bower and NPM with it easily, you can debug it, run it into the browser, interact with it live in the browser, wrap it into a native Android or iOS app via integrated Cordova tooling, deploy to Android and iOS, etc etc etc. And all for free!

However, each of these new JavaScript frameworks comes with their own special (some might say "squirly") addition to the syntax of JavaScript, which breaks the editor, as shown below, i.e., click to enlarge the screenshot and then look at the error marks:

That makes the editor unusable for React.js and for whatever new JavaScript framework pops up over night to claim the "we are the coolest JavaScript framework in town" prize of the moment. Rather than running after each and every framework and providing tools for it and then finding that by the time the tools are released no one cares about the framework anymore, a simple solution is to let the user turn off the error marks in the JavaScript editor:

https://netbeans.org/bugzilla/show_bug.cgi?id=251797

Here's how it works, from the next release onwards, and already in development builds, i.e., not in NetBeans IDE 8.0.2, but in the next release. You'll simply click on one of the yellow lightbulbs and then NetBeans will offer a scope within which the error parsing should be disabled:

Right now, the above will result in the below:

Notice that there are still some error underlines, though everything else has been filtered out, which is being tracked here:

https://netbeans.org/bugzilla/show_bug.cgi?id=252179

Onwards to a future proof NetBeans IDE!

Join the discussion

Comments ( 8 )
  • alex Thursday, April 30, 2015

    But if you do that, you'll lose all error highlighting. Unfotunately weakly typed languages are brutal on IDEs/parsers. Which is one of the reasons I never particularly liked javascript.


  • Geertjan Thursday, April 30, 2015

    Yup. That's why I like Java and also why I think DukeScript.com is a good solution.


  • alex Thursday, April 30, 2015

    I like GWT and Dart/AngularDart, but compiling _into_ javascript still has some drawbacks. I'm going to look at Coffe/TypeScript, maybe those will look better, but I doubt the tooling around those is mature enough.


  • Geertjan Friday, May 1, 2015

    Skip all that and just go straight to DukeScript.com. Save yourself some time.


  • naza Friday, May 8, 2015

    How do you deal with jsx formatting?


  • guest Friday, January 15, 2016

    I just did this, I don't like it and I want it back to normal, again. How the f@#ck am I supposed to do this? I coulndn't find any undo option to disable the filter I just turned on. You make it really, really hard for me to actually like Netbeans.


  • Henry Friday, January 15, 2016

    Do you talk like this to people in real life? If not, why is it acceptable to talk like this to someone in the comments of a blog?


  • Ali Friday, May 12, 2017
    How do you undo the disable? I am unable to figure out how to turn the parsing back on.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
 

Visit the Oracle Blog

 

Contact Us

Oracle

Integrated Cloud Applications & Platform Services