如何在Eclipse文本编辑器中获取格式的语法高亮? [英] How can I get syntax highlighting for my format in an Eclipse text editor?

查看:283
本文介绍了如何在Eclipse文本编辑器中获取格式的语法高亮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse文本编辑器中,我需要具有特定结构的文本的语法高亮。这个方案很简单基本上每行都有六个字被白空间分开,以#开头的行是注释。最重要的是突出意见,但是对于未评论的行中的六个要素进行单独着色将是有用的。

I need syntax highlighting for text with a specific structure in an Eclipse text editor. The scheme is simple; basically each line has six words separated by white-space, and lines starting with # are comments. Most important is to highlight the comments, but it would be useful to individually color the six elements in the non-commented lines.

如果太难以获得,我可以使用一个现有的插件,意味着类似语法的东西。任何建议?

If it is too complicated to obtain, perhaps I could use an existing plugin meant for something with a similar syntax. Any suggestions?

推荐答案

如果您想编写自己的编辑器,可以尝试 XText 。使用XText,您可以为自己的DSL(域特定语言)编写编辑器,我怀疑是您拥有的。编辑也支持自动完成和其他不错的功能。我迄今没有尝试过XText,但我听说这很容易学习。

If you want to write your own editor, you could try XText. With XText you can write editors for your own DSL (Domain Specific Language), which i suspect is what you have. The editors also support auto completion and other nice features. I haven't tried XText so far, but i heard that it's pretty easy to learn.

如果高亮显示评论就足够了,还可以尝试分配文件结束像属性文件的配置,属性文件中的sincec注释也是#。您可以在窗口 - >首选项 - >编辑器 - >文件关联中编辑配置,然后为文件类型选择属性文件编辑器。

If highlighting of the comments is enough, you can also try to assign your file endings like the configuration for properties files, sincec comments in properties files are also a #. You can edit the configuration in Window -> Preferences -> Editors -> File Associations and then choose the Properties File Editor for your file type.

这篇关于如何在Eclipse文本编辑器中获取格式的语法高亮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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