您现在的位置是:首页 > PHP框架交流PHP框架交流

phpstorm 新建php文件显示为文本 不提示php语法

上善若水2022-02-14 22:35:38【PHP框架交流】 2047人已围观

简介phpstorm 新建php文件显示为文本 不提示php语法 跟显示txt文本文件一样 不提示任何语法 不变任何颜色 把文件删除 重新建还是一样 默认一文本方式打开 终于找到方法解决.1.首先在设置中

phpstorm 新建php文件显示为文本 不提示php语法 跟显示txt文本文件一样 不提示任何语法 不变任何颜色 把文件删除 重新建还是一样 默认一文本方式打开 终于找到方法解决.
1.首先在设置中排除
Settings → Editor → File Types→ Text
For OS X
Preferences → Editor → File Types→ Text


发现在Text列表中 没有要找到的文件. 将显示类型出错的PHP名字添加进列表 提示 phpstorm file type auto-detected by file content
点击左边重置 然后将刚才添加到php文件删掉解决问题.

2.方式二 若提示上面的提示可以按照官方文档提示操作

网上一般是按照方式一解决问题 但是方式二实际上更快!

ssociate a filename pattern with specific file type
If PhpStorm cannot identify the type of the file that you are trying to open or create, it displays the Register New File Type Association dialog where you can choose the way you want to process this file.

If the dialog doesn’t appear automatically, right-click the file in the Project tool window and select Associate with File Type from the context menu or choose File | File Properties | Associate with File Type from the main menu.

In the Register New File Type Association dialog, select the necessary options:

PhpStorm: Associating a filename pattern with specific file type
From the File pattern list, select whether you want to specify a type for the current file (file.extension) or for all files with this extension (*.extension).

Select one of the following options:

Open matching files as text and auto-detect file type by content: open the file without an extension as a text file and identify its type by the content, for example, by the shebang line.

Open matching files in PhpStorm: associate the file with one of the existing file types. You can change this association later in the settings.

Open matching files in associated application: open the file in the default system application configured in your operating system. For example, .pdf files are opened in the default PDF viewer.

If necessary, you can check and configure all filename patterns associated with system applications.

Click OK to apply the settings.

很赞哦! (1)

相关文章

随机图文

文章评论

站点信息

  • 建站时间:2019-10-24
  • 网站程序:Thinkphp6 Layui
  • 文章统计247篇文章
  • 标签管理标签云
  • 统计数据cnzz统计
  • 微信公众号:扫描二维码,关注我们