(Within JetsBrains / WebStorm IDE) Initially I created a file called HelloWorldContainer
- accidentally left out the .js
extension (I meant to create HelloWorldContainer.js
).
WebStorm asks what file type I would like that file to be (e.g. JavaScript? Text File? HTML? etc.). I accidentally hit the enter key - and WebStorm has treated it as a text file.
Realising my mistake, I renamed the file to HelloWorldContainer.js
(adding that .js
to the end`). Hoping this will change the file type back to a JavaScript file.
For some reason, WebStorm is still "seeing" HelloWorldContainer.js
as a text file??? (snapshot below). This is a problem as now my JavaScript Live Templates no longer load for this file.
Snapshot 1: showing HelloWorld.js
as a JavaScript file, whilst HelloWorldContainer.js
showing as a text file (huh?).
Snapshot 2: for HelloWorld.js
, WebStorm knows it is a JavaScript file - Live Templates successfully loaded as a result. (Cmd + J)
Snapshot 3: for HelloWorldContainer.js
, WebStorm (for some reason) fail to recognise it as a JavaScript file - the JavaScript Live Templates fail to load as a result. (Cmd + J)
How to I make WebStorm recognise HelloWorldContainer.js
as a JavaScript file again?
Note: I've tried...
HelloWorldContainer.js
and recreate it again, WebStorm is still seeing it as a text file.HelloWorldContainer.js
to HelloWorldContainer2.js
- WebStorm now sees it as a JavaScript file. But if I rename it back to original name, WebStorm sees it as a text file again. (I really want to call my file HelloWorldContainer.js
! :-)Just tried out the solution provided below (by @LazyOne)- works like a charm! Some snapshots for note keeping...
Snapshot 4: remove the offending pattern.
Snapshot 5: WebStorm now sees the file as a JavaScript again!
Settings/Preferences | Editor | File Types
Text
entry in top listHelloWorldContainer.js
or very similarOK
and wait till project will be re-indexed.