Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I work with a lot of javascript files that are not suffixed by ".js", so Intellij renders no code style at all (no coloration or auto-complete) unless I put <script> tags around the code (which won't work). Is there a way in the Code Style menu to set my default code style to javascript for files on which intellij is unclear?

share|improve this question
up vote 2 down vote accepted

Go to File -> Settings -> File Types there in Recognize File Types panel choose JavaScript files and then add new Wildcard for it.

enter image description here

Hope I solve your issue.

share|improve this answer
Thank you, this is the right answer, though I still have a couple issues. When I do this, intelliJ runs out of memory and has to re-index all my files on restart! I really wish intelliJ could mark up files as I open them rather than all at once when I set a new rule. Also, the server-side code I have mixed in with the JS messes up the file's formatting, but I guess that's to be expected. – Amalgovinus Feb 3 '14 at 19:24
@Amalgovinus you can select each file individually. In context menu of the file, choose Accociate with File type. But this feature work not all files without extension, seem bug. – Anton Dozortsev Feb 3 '14 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .