关于开发定制Eclipse编辑器的教程 [英] Tutorial regarding the development of a custom Eclipse editor

查看:133
本文介绍了关于开发定制Eclipse编辑器的教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解如何为特定编程语言开发Eclipse编辑器。有没有可以帮助我的教程?如果它涵盖了语法高亮和自动完成等主题,那将是有益的。

解决方案

我从这一个。这是一个过去的一年,当我使用它,但概念保持不变。



最好的事情我可以建议代替一个如何将是找到已经整合的语言,看看它们是如何做到的。这是真正的建议 - 不要选择一个以 org.eclipse 开头的软件包名称(如ant)。 eclipse提供了如此多的支持,如果从另一个包前缀开始,看看需要编写的代码要容易得多。尝试查看 groovy scala 插件。



根据我的经验,这是错误突出显示哪个是最难做的准确的;下一个最重要的是内容帮助。



如果您控制编辑器或编辑器的语言的运行时间,那么如果您可以让编译器为您提供IDE向用户提供的所有数据(例如令牌列表 - 用于语法着色,工具提示;内容协助将会更好,因为您不是伪造编译器,而是使用真正的一个;与错误突出显示相同)。



IDE比较容易,只显示错误和着色等。



一旦你有它只能显示,示例XML编辑器看起来非常有用。



我发现的大部分分区规则不太有用;我一直最终建立自己的 - 二进制搜索列表中的令牌非常有用。


I wish to learn about developing an editor for Eclipse for a particular programming language. Is there a tutorial available to help me with this? It would be beneficial if it covered such topics as syntax highlighting and auto-completion.

解决方案

I started at this one. It was a year out of date when I used it, but the concepts have stayed the same.

The best thing I can suggest in lieu of a how-to would be to take find a language that is already integrated, and see how they do it. Here's the real advice - don't pick one with a package name that begins with org.eclipse (like the ant one). There are so much support provided by eclipse, it is much easier to see what code you need to write if it starts with another package prefix. Try looking at the groovy or scala plugins, for example.

In my experience, it is the error highlighting which is the hardest to do accurately; next hardest is content assist.

If you are in control of the compiler or runtime of the language that you're writing an editor, it makes life a lot easier if you can get the compiler to give you all the data your IDE will need to present it to the user (e.g. list of tokens - for syntax colouring, tooltips; content assist will be much better, because you're not faking a compiler, but using the real one instead; same with error highlighting).

The IDE has the relatively easy job of only displaying errors, and colouring, etc.

Once you have it down to display only, the example XML editor looks quite useful.

Much of the partitioning rules I have found less useful; I've always ended up building my own - binary search over a list of tokens is extremely useful.

这篇关于关于开发定制Eclipse编辑器的教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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