简体   繁体   English

如何分别更改PHPStorm中带有.php扩展名的文件的代码样式颜色?

[英]How to individually change Code style color for files with .php extension in PHPStorm?

I looked up the PHPStorm manual and also searched for related questions here, but I didn't find a solution. 我查阅了PHPStorm手册,并在此处搜索了相关问题,但没有找到解决方案。 So I don't know if this is even possible. 所以我不知道这是否有可能。

(Note that one question here on StackOverflow has a similiar title as mine but what I mean is something different than asked there!) (请注意,StackOverflow上的一个问题与我的标题类似,但我的意思与那里的要求有所不同!)

I have a file with a .php-extension but I mainly edit JavaScript-code in there. 我有一个扩展名为.php的文件,但我主要在其中编辑JavaScript代码。 But there are some lines where I need to work with PHP, that's why I include this PHP file. 但是有些地方需要使用PHP,这就是为什么要包含此PHP文件的原因。 However because of this .php-extension there isn't any JavaScript recognized by the IDE. 但是,由于此.php扩展名,IDE无法识别任何JavaScript。 Is there a way to individually change a specific file formatting or handling it as JavaScript, even if it's a PHP file? 有没有办法单独更改特定文件的格式或将其作为JavaScript处理(即使它是PHP文件)?

File | 档案| Settings | 设置| Editor | 编辑器 File Types for Windows and Linux PhpStorm | Windows和Linux PhpStorm的文件类型| Preferences | 首选项| Editor | 编辑器 File Types for OS X Ctrl+Alt+S OS X的文件类型Ctrl + Alt + S

Click this button to open the New File Type dialog and define a new custom file type there OR Click this button to open the Edit File Type dialog box and edit the selected file type there. 单击此按钮打开“新建文件类型”对话框并在其中定义新的自定义文件类型,或者单击此按钮以打开“编辑文件类型”对话框并在其中编辑所选文件类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM