Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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 at 19:24
1  
@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. –  Dozortsev Anton Feb 3 at 20:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.