Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm renders a particular file name as plain text

Tags:

phpstorm

For some reason, PHPStorm has decided to render any file named root.js as plain text without the JS coloring and debugging. Does anyone know how to correct this issue??? It is driving me crazy!!!

like image 213
Andrew Rhyne Avatar asked Jan 30 '13 21:01

Andrew Rhyne


People also ask

Is PhpStorm a text editor?

Free and open source text editor that allows users to work across multiple operating systems with CSS and other features.

What language does PhpStorm use?

Supported languages With PhpStorm, you can develop applications in PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, PHP 8.0, and PHP 8.1.

What is create associations in PhpStorm?

To create an association, open an XSLT file in the editor, select File Associations | Add... from its context menu, and then select the X(HT)ML files to associate with the opened XSLT. To cancel association for a file, click its filename in the File Associations group.

How do I open a PhpStorm file?

In the editor, press Ctrl+Alt+F12 or in the context menu, select Open in | Finder. In the Reveal in Finder popup, select a file or a directory to open in a path finder and press Enter .


2 Answers

Go to IDE Settings -> File types and look for Text files in Recognized file types. There might be an added pattern named root.js

enter image description here


For newer versions this setting is found in Editor -> File types

enter image description here

like image 98
dan-lee Avatar answered Sep 30 '22 10:09

dan-lee


I just tried this in PHPStorm 5.0.4 and I don't have this problem - all the JS is colour coded fine.

I used right-click > New > JavaScript File to add the file.

like image 27
Fenton Avatar answered Sep 30 '22 09:09

Fenton