Webstorm无法识别JavaScript文件 [英] Webstorm not recognising JavaScript file

查看:1365
本文介绍了Webstorm无法识别JavaScript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Webstorm无法识别我的一个.js文件作为JavaScript文件,所以我失去了语法高亮,并能够添加断点。我查看了 workspace.xml 文件,该文件似乎与其他正常工作的.js文件具有相似的设置。

Webstorm doesn't recognize one of my .js files as a JavaScript file so I'm losing syntax highlighting and being able to add break points. I've looked in the workspace.xml file and the file in question seems to have similar settings to other .js files that work correctly.

如果我更改文件的名称,它可以正常工作。所以Webstorm不知何故误解了具有此名称的文件的类型。我还能在哪里编辑项目?

If I change the name of the file it works ok. So somehow Webstorm is stuck on misinterpreting the type of a file that has this name. Where else can I edit the project?

推荐答案

所以我看到了问题的三个可能原因:

So I see three possible reasons of the problem:

1)文件被标记为纯文本

1) The file was marked as 'Plain text'

2)文本文件文件类型的模式与此文件匹配(或返回:文件类型'JavaScript'排除此文件名)。见下图:

2) There is a pattern for 'Text files' file type that matches this file (or back: file type 'JavaScript' exclude this file name). See image below

3)有一个自定义插件覆盖具有此名称的文件的默认行为(不太可能)

3) There is a custom plugin that overrides default behaviour for files with this name (unlikely)

注意:解决方案适用于所有基于IDEA的IDE:IntelliJ IDEA,WebStorm,RubyMine,PyCharm,PhpStorm。

Note: the solution works for all IDEA-based IDEs: IntelliJ IDEA, WebStorm, RubyMine, PyCharm, PhpStorm.

这篇关于Webstorm无法识别JavaScript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆