如何扩展netbeans javascript编辑器内容辅助以查看Rhino可访问实体
我介绍了一种基于 Rhino 的脚本语言。在这种语言中,就其本质而言,编写如下内容是合法的:
var y = new org.mypackage.JavaClass();
print(y.javaMethodReturnsString());
这意味着我正在混合 Java 实体和 Javascript 实体。 我希望为我的新语言制作一个 netbeans 编辑器插件。该编辑器必须具有内容辅助功能。
现在,JavaScript 实体默认出现在 JavaScript 编辑器内容辅助中。 我想我可以扩展 netbeans javascript 编辑器,但是如何扩展呢?是哪一类? 那么,如何使用 java 实体扩展内容辅助范围呢?
或者也许我应该制作自己的编辑器并“导入”java 和 javascript 内容辅助行为?但话又说回来,怎么办?
谢谢
编辑:为了在类路径中包含java实体,我遵循了这篇博客文章: 代码完成中的 Java 类 顺便说一下,只有当编辑的文档位于源文件夹中时,这才有效。 关于扩展 javascript 编辑器的问题仍然悬而未决。有人吗?
I have introduced a Rhino-based scripting language. In this language, by its nature of course, it is legal to write something like:
var y = new org.mypackage.JavaClass();
print(y.javaMethodReturnsString());
Which means I'm mixing Java entities and Javascript entites.
I wish to make a netbeans editor plugin for my new language. This editor must feature content assist.
Now, the javascript entites appear in the javascript editor content assist by default.
I guess I can extend the netbeans javascript editor, but how? Which class is it?
Then, how do I extend the content assist scope with the java entities?
Or maybe I should make my own editor and "import" java and javascript content assist behavior? But again, how?
Thank you
EDIT: to have the java entities in the classpath, I followed this blog post :
Java Classes in Code Completion
by the way, this works only if edited document is in a source folder.
Still remains open the question about extending javascript editor. Anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使这个问题值得风滚草成就,我自己也找到了解决方案。我编写了一个 netbeans 模块来处理 Rhino 脚本上的内容辅助。它处于早期开发阶段,是我的第一个 netbeans 插件,但总比没有好。
该插件可以针对 javascript 文件打开/关闭,并且可以进行类扩展以适应任何 rhino 解释的语言,这是我接下来要做的事情。
Javascript Rhino 上下文插件
Even if this question was worth the Tumbleweed achievement, I found a solution myself. I've written a netbeans module to handle content assist on Rhino scripts. It's in early development and it's my first netbeans plugin but should be better than nothing.
The plugin can be turned on/off for javascript files and can be class-extended to suit any rhino-interpreted languages, which is the next thing I'm into.
Javascript Rhino context plugin