0

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?

2

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.

| 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
  • 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. – Anton Dozortsev Feb 3 '14 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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