本文介绍了如何在adobe-brackets编辑器中添加文件扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Web项目中使用扩展名为 .html.eco 的文件,并且尝试在Adobe Brackets中进行编辑,但是我无法指定将其视为HTML文件以提供编辑html文件的典型功能(例如颜色支持,语法等)。

I am using files with .html.eco extension in my web project and I am trying to edit in Adobe Brackets but I can't specify that it should treat this as HTML file, to provide the typical features of editing html file (like color support, grammar, etc.).

事实上,我注意到在更改 languages.json文件时这是可能的,但是我使用的是二进制版本,而不是从源代码构建的。

In fact I noticed that this is possible when changing languages.json file, however I am using the binary version and I didn't build from source.

有帮助吗?

推荐答案

更新:现在,这要容易得多要做:

Update: this is now much easier to do:


  1. 打开.html.eco文件

  2. 在状态栏中(下方-右),单击显示文本的下拉列表

  3. 选择 HTML选项

  4. 再次打开下拉列表,然后选择设置为默认值 op

  1. Open the .html.eco file
  2. In the status bar (lower-right), click the dropdown that says "Text"
  3. Select the "HTML" option
  4. Open the dropdown again and select the "Set as Default" option at the top






原始答案:

有一个,以使其易于配置(请赞成!),但与此同时,您可以通过编写一个非常简单的Brackets扩展程序来做到这一点:

There's a backlog item for making this easily configurable (please upvote!), but in the meantime you can do it by writing a very simple Brackets extension:

define(function (require, exports, module) {
    var LanguageManager = brackets.getModule("language/LanguageManager");
    var language = LanguageManager.getLanguage("html");
    language.addFileExtension("html.eco");
});




  1. 将此代码放在名为main.js的文件中

  2. 在括号中,转到帮助>显示扩展文件夹

  3. 用户下创建一个新文件夹,然后放置其中的main.js文件

  4. 重新启动括号

  1. Put this code in a file named main.js
  2. In Brackets, go to Help > Show Extensions Folder
  3. Create a new folder under user, and place the main.js file inside it
  4. Restart Brackets

这是(如果您感到好奇的话)。

Here's more info on writing Brackets extensions, if you're curious.

这篇关于如何在adobe-brackets编辑器中添加文件扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 06:19