从 Eclipse 中提取代码辅助/完成部分并在其他编辑器中使用它是否可行?

发布于 2024-12-01 18:18:51 字数 473 浏览 4 评论 0原文

我经常听说 Eclipse 的代码完成、编码辅助功能与其他编辑器相比有多好,这引发了一个问题:是否可以将这些部分从 Eclipse 代码库中分离出来。

如果这部分用 API 分开,通过 API 可以告诉它需要知道的事情(项目的文件在哪里,包含路径是什么,等等),那么它可以返回必要的信息(符号的帮助位于光标、可能的补全等)和任何编辑器(emacs、vim 等)都可以使用它。

为什么还没有完成?这些代码辅助部分是否与 Eclipse 内部联系得太紧密并且无法轻松分离?了解 Eclipe 内部工作原理的人可以解释一下吗?

编辑:这是针对 C# 的 SharpDevelop 的工作设置,emacs 是 UI,信息来自 SharpDevelop 模块。请参阅此页面的屏幕截图。 Eclipse 的补全支持可以类似地支持 emacs 和其他编辑器。

I often hear how good the code completion, coding assist features of Eclipse are compared to other editors which raises the question if these parts could be separated from the Eclipse code base.

If this part is separated with an API through which it can be told things it needs to know (where are the files of the project, what are the include paths, etc.) then it can return the necessary information (help for a symbol at the cursor, possible completions, etc.) and any editor (emacs, vim, etc.) can use it.

Why is it not done already? Are these code assist parts tied too tightly to Eclipse internals and they can't be sepaarated easily? Could someone who knows about the internal workings of Eclipe shed some light on this?

Edit: Here's a working setup with SharpDevelop for C#, emacs is the UI and the info comes from the SharpDevelop module. See the screenshot on this page. Eclipse's completion support could support emacs and other editors similarly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一曲琵琶半遮面シ 2024-12-08 18:18:51

eclim 项目试图通过直接与 eclipse 交互来解决这个问题。因此至少需要一个无头运行的 eclipse。虽然 eclim 的重点是 vim 集成,但也存在其他编辑器(emacs、textmate 等)的插件。 eclim 和编辑器之间的通信通过服务器接口进行。

也许不完全是你在寻找的东西,但恕我直言值得一看:

http://www.eclim.org/

The eclim project tries to solve this problem by interfacing directly with eclipse. Thus at least an headless running eclipse is required. While eclim's focus is afaik the vim integration, there also exist plugins for other editors (emacs, textmate, etc). The communication between eclim and an editor happens through a server interface.

Maybe not exactly what you where looking after, but imho worth a look:

http://www.eclim.org/

望喜 2024-12-08 18:18:51

内容辅助使用 Java 项目的内部模型 - 如果没有此模型,内容辅助就无法(有效地)工作。

我不确定与 Eclipse 内部集成的紧密程度,但我确实知道它使用 Eclipse 资源 API(文件系统处理)和其他功能,例如 Eclipse 扩展(可以添加新的完成提供程序而无需修改代码)。

总而言之,我相信将此完成引擎移植到其他编辑器,提到的编辑器将失去对 Eclipse 的(在某些情况下相对)简单性,因此它可能不会提供提到的编辑器的更小的占用空间 - 所以我不认为,它是为其他编辑者有效地提供此类引擎是可行的。

The content assist uses an internal model of the Java projects - without this model the content assist cannot work (that effectively).

I am not sure, how tightly is integrated to Eclipse internals, but I do know that it uses the Eclipse Resources API (file system handling) and other features such as Eclipse extensions (new completion providers can be added without modifying the code).

Alltogether, I believe to port this completion engine to other editors the mentioned editors would lose their (in some case relative) simplicity to Eclipse, thus it might not provide the smaller footprint of the mentioned editors - so I don't think, it is feasible to provide such engines effectively for other editors.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文