Eclipse for Roo 项目中的自动完成

发布于 2024-08-28 00:26:10 字数 247 浏览 13 评论 0原文

我有一个 Roo 项目,我在其中创建了几个实体,当我在 Eclipse 中加载该项目时,它加载得很好,但是如果我创建一个实例 MyEntity实体 然后编写entity. 我没有在自动完成列表中获取任何属性(即 getMyField)。如果我编写 entity.getMyField() 它编译得很好,这是由方面处理的。如何为方面生成的函数启用自动完成功能?

干杯

尼克

I've got a Roo project where I've made a couple of entities, and when I load up the project in Eclipse it loads up fine, but if I i.e. make an instance MyEntity entity and then write entity. I don't get any of my properties (i.e. getMyField) in the autocompletion list. If I write entity.getMyField() it compiles fine, that is taken care of by the aspects. How do I enable autocompletion for functions generated by the aspects?

Cheers

Nik

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

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

发布评论

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

评论(2

淡写薰衣草的香 2024-09-04 00:26:10

您使用哪种“类型”的 Eclipse?您的 eclipse 中是否安装了 AJDT?如果是这样,仍然可以选择禁用 JDT 编织。下面的注释(摘自 Roo 文档)应该可以帮助您打开 JDT 编织(窗口 -> 首选项 > JDT 编织。

使用 AJDT 时,系统可能会提示您
是否启用JDT的编织。
您应该选择启用编织,以便
以确保 Java 编辑器
Eclipse(或STS)给出了最好的
基于AspectJ的体验。您还可以
验证此设置是否处于活动状态
加载 Eclipse(或 STS)并选择
窗口>首选项> JDT编织。

顺便问一下,您是否考虑过尝试Spring Source Tool Suite?在那里您可以找到已安装的所有插件(AJDT 支持...)。它非常适合 Roo,因为它在 eclipse 中提供了 Roo 功能。

Which "type" of eclipse are you using? Do you have AJDT intstalled within your eclipse? If so there is still an option to disable weaving of JDT. The note below (taken from the Roo documentation) should help you to turn on JDT weaving (Window -> Preferences > JDT Weaving.

When using AJDT you may be prompted
whether to enable weaving of the JDT.
You should select to enable weaving so
as to ensure the Java Editor in
Eclipse (or STS) gives the best
AspectJ-based experience. You can also
verify this setting is active by
loading Eclipse (or STS) and selecting
Window > Preferences > JDT Weaving.

By the way have you considered trying the Spring Source Tool Suite? There you find all the plugins (AJDT support...) already installed. And it fits very well for Roo as it offers Roo functionality from within eclipse.

记忆消瘦 2024-09-04 00:26:10

我遇到了与 niklassaers 相同的问题:Roo AspectJ 方法在编译时未显示在 Eclipse 自动完成中。我使用的是最新版本的 STS,默认安装了 AJDT,并验证了 JDT Weaving 处于活动状态,但问题仍然存在。

另一方面,我发现执行 Maven >更新项目... (Alt-F5) 使 ROO AJ 方法对自动完成可见。

该解决方案可能与我构建项目的方式有关(我的工作区中有两个 eclipse Maven 项目,myproject.data 包含带有 aj 方法的 roo 类,以及 myproject.services充当这些课程的客户端);此外,每次打开工作区时我都必须重复 Alt-F5,但这似乎有效。

我想更好地理解这个代码完成问题的原因,也许找到一些方法来永久解决该问题,而不必每次都更新 Maven 项目。是否与AJDT插件和m2eclipse Maven插件之间的交互有关?

I have experienced the same problem as niklassaers: Roo AspectJ methods not showing in eclipse autocompletion while compiling fine. I'm using the latest version of STS, with AJDT installed by default, and verified that JDT Weaving is active, but the problem persists.

On the other hand, I've found out that executing Maven > Update project... (Alt-F5) makes the ROO AJ methods visible to auto completion.

This solution might be related on how I structured my project (I have two eclipse Maven projects in my workspace, myproject.data containing roo classes with aj methods, and myproject.services acting as a client for those classes); besides, I have to repeat Alt-F5 every time I open my workspace, but this seems to work.

I'd like to understand better the reasons of this code completion problem, and maybe find some way to solve the problem permanently, without having to update maven projects every time. Could it be related to interactions between the AJDT plugin and m2eclipse Maven plugin?

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