简体   繁体   English

Notepad ++无法将.js文件检测为javascript代码

[英]Notepad++ not detect .js file as javascript code

I am writing javascript code using notepad++. 我正在使用记事本++编写javascript代码。 I found this problem and i don't know how to solve it. 我发现了这个问题,我不知道如何解决。

When i open/create a new javascript file, i have to set the language to Javascript so the display will be changed. 当我打开/创建一个新的javascript文件时,我必须将语言设置为Javascript,以便更改显示。 Here's the example. 这是例子。 我写了一行“测试脚本”

i wrote a line "testing script" 我写了一行“测试脚本”

然后我将其作为注释行,但字体颜色仍为黑色。

And then i made it as a comment line, but the font color is still black. 然后我将其作为注释行,但字体颜色仍为黑色。 The comment should written in green color. 注释应为绿色。

在此处输入图片说明

I need to change the language to Javascript so it could be read as a javascript code and i could use the shortcut, just like ctrl+q to comment a line. 我需要将语言更改为Javascript,以便可以将其作为JavaScript代码阅读,并且可以使用快捷方式,就像ctrl + q注释一行一样。

I don't why this is happened. 我不明白为什么会这样。 But it just happened after i update notepad++. 但这只是在我更新记事本++之后发生的。 Can anyone help. 谁能帮忙。 This also happened when i open existing javascript code. 当我打开现有的javascript代码时,也会发生这种情况。

I am also using the newer version of notepad++ but the comment function is working great. 我也在使用较新版本的notepad ++,但注释功能运行良好。 just to sure try saving it first with the js extension and then try to comment the line it. 只是要确保先尝试使用js扩展名保存它,然后再对其注释行。 hope it works for you! 希望这对你有用!

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

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