Enable Javascript intellisence

已回答

I have an html file that contains only javascript but no script tag. As a result phpstorm renders the file as a text file, although it has only javascript. Is there a way that I can set phpstorm to interpret that html file as a javascript file  ( i.e. customise override phpstorm to view the file as javascript )

Alec

0

Hi there,

  1. If you can -- give it a custom (e.g. "file.jhtml) or double (e.g. "file.js.html") file extension .
  2. Then associate appropriate pattern  (e.g. *.js.html) in "Settings/Preferences | Editor | File Types" with "JavaScript" file type.

If renaming a file is not possible -- then the only option AFAIK is to associate whole file name (e.g. "file.html") with that file type (see #2 above). Downside -- it will affect ALL files with such name in ALL projects. So if that is some commonly used file name ... it will be rather problematic to use it.

1

请先登录再写评论。