IntelliJ: how to force editor to treat a file as javascript?

The above answer is slightly outdated. You can do the same in IntelliJ 14 by doing the following:

  1. Go to Preferences (Mac OSX : Cmd + Comma)
  2. Under Editor -> File Types
  3. In the Recognized File Types Highlight JavaScript files (JavaScript)
  4. Under Registered Patterns press the + button
  5. Enter your regex pattern (for example: *.js.scala.html) and press OK

Cheers!

Leave a Comment